Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Dynamic File Paths in Build Commands #1166

Open
1 task done
Harsh-Malakar opened this issue Jan 25, 2025 · 0 comments
Open
1 task done

Add Support for Dynamic File Paths in Build Commands #1166

Harsh-Malakar opened this issue Jan 25, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@Harsh-Malakar
Copy link

Check for existing issues

  • Completed

Describe the feature

Proposed Solution:

Add support for resolving placeholders like ${file}, ${fileDirname}, etc., in the command section of build configurations.

Optionally provide a way to test or validate the command syntax directly in the app.

If applicable, add mockups / screenshots to help present your vision of the feature

Description:

Currently, Acode lacks support for dynamically referencing file paths in custom build commands. This makes it difficult to automate workflows for languages like C++ when compiling and running files. For example, many editors use placeholders such as ${file} for the full path of the currently open file, ${fileDirname} for the file's directory, and ${fileBasenameNoExtension} for the file name without the extension.

Without this functionality, users have to hard-code file paths into commands, which is not practical when working with multiple files.


Example Use Case:

For C++ compilation and execution, the following dynamic command should work:

{
"extension": "cpp",
"name": "C++",
"command": "g++ '${file}' -o '${fileDirname}/${fileBasenameNoExtension}' && '${fileDirname}/${fileBasenameNoExtension}'"
}

Here:

${file} refers to the full path of the currently open file.

${fileDirname} refers to the directory of the file.

${fileBasenameNoExtension} refers to the file name without the extension.

This feature is essential for users who rely on Acode for programming on mobile devices.


Current Behavior:

When attempting to use placeholders (e.g., $HOME, ${file}), Acode does not resolve these dynamically. Instead, it either throws an error or treats them as literal strings.


Expected Behavior:

Acode should support the following placeholders:

  1. ${file}: Full path of the file.

  2. ${fileDirname}: Directory of the file.

  3. ${fileBasename}: File name with the extension.

  4. ${fileBasenameNoExtension}: File name without the extension.


Proposed Solution:

Add support for resolving placeholders like ${file}, ${fileDirname}, etc., in the command section of build configurations.

Optionally provide a way to test or validate the command syntax directly in the app.

@Harsh-Malakar Harsh-Malakar added the enhancement New feature or request label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant