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

Support of variables within more/all build system fields #1013

Open
SaschaMzH opened this issue Oct 22, 2015 · 2 comments
Open

Support of variables within more/all build system fields #1013

SaschaMzH opened this issue Oct 22, 2015 · 2 comments

Comments

@SaschaMzH
Copy link

There are a lot of possibilities to customize the build system with variables.
But I miss the possibility to use the variables also within the env arbitrary option.

For example:
The following sublime-project file will print PYTHONPATH=${project_path}/my_path instead of the replaced project path

{
    "folders":
    [
        {
            "name": "Env Examples",
            "path": "."
        }
    ],
    "build_systems":
    [
        {
            "name": "Echo",
            "env":{
                "PYTHONPATH":"${project_path}/my_path"
            },
            "working_dir":"${project_path}",
            "shell_cmd": "printenv"
        }
    ]
}
@FichteFoll FichteFoll changed the title Support of variables within env path's of build systems Support of variables within more/all build system fields Jan 23, 2016
@FichteFoll
Copy link
Collaborator

I expanded this issue to cover more/all fields in build systems. It doesn't really make sense to limit expansion to only a few keys when it could find use in almost every field, so might as well apply it to all. If the literal ${something} is desired, then ST allows escaping dollar signs in its snippet syntax too.

By the way, since besides cmd and shell_cmd all relevant fields are expanded in Default/exec.py anyway, it would be as easy as adding a few calls to the API in that file. It could even be grouped cleverly and reduced to one call.

Example: sublime.expand_variables(working_dir, sublime.extract_variables())

Related: #259

@keith-hall
Copy link
Collaborator

also related: #918

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants