pucelle / vscode-run-on-save

Run configured shell commands when a file is saved in vscode, and output configured messages on status bar.
https://marketplace.visualstudio.com/items?itemName=pucelle.run-on-save
MIT License
51 stars 14 forks source link

Support environment variable substitution in command and globMatch #31

Closed jackwhelpton closed 10 months ago

jackwhelpton commented 11 months ago

As described here:

https://code.visualstudio.com/docs/editor/variables-reference#_environment-variables

In my case this is useful so I can monitor changes of files in custom folders without hardcoding any paths:

    "runOnSave.commands": [
        {
            // Match dotfiles
            "globMatch": "${env:XDG_DATA_HOME}/chezmoi/**",
            "command": "cfg apply",
            "runIn": "terminal",
            "runningStatusMessage": "Applying ${fileBasename}",
            "finishStatusMessage": "${fileBasename} applied"
        }
    ],

I've had a first stab at it here: https://github.com/pucelle/vscode-run-on-save/pull/30

pucelle commented 10 months ago

v1.7.0 released and support this.