Closed kagalle closed 5 years ago
Yeah, this confused me, too.
There should also be an placeholder to get the relative path to file from the current working directory after a cd
command. Even better would be to specify a cwd.
I want to use run on save to avoid stupid gulp tasks for copying html files to by build directory, but it is a pain to preserve the current sub-path structure when the only path I can retrieve is the absolute path.
currently my config looks this way:
"emeraldwalk.runonsave": {
"autoClearConsole": true,
"commands": [
{
"match": "\\.html$",
"cmd": "cd ${workspaceRoot} && copyfiles -u 1 './src/**/*.html' './build/'"
}
]
}
copyfiles is a globally installed npm module
Problem is, that it copies ALL files every time. But this is this the only way to get the subfolder structure preserved, as it uses glob pattern matching. I have no placeholder available to get the current file relative to the current working directory (as ${cwd}
is always pointing to /
}.
@MartinMajewski Latest RunOnSave release added ${relativeFile} placeholder
The "shell" configuration option had me confused becuase its hint text is:
I read this to mean that it set the working directory in which the command is run. After reading the issue regarding shell, I realized it has to do with the actual shell the command is run in. I was able to get the desired behavior for my particular use by writing the command as
cd ${workspaceRoot} && npm run-script browserify
. The hint might be edited to