While setting up the tasks.json to build, I want to use the buildEvent:after_build_success to copy my output files for debugging.
However, the working directory is actually left at the shell default, which is the home directory for VSCode. When I set it as:
"buildEvent": {
"after_build_success": [
"echo %CD%,
"xcopy /Y * C:\\Users\\bo3bdar\\Documents\\source\\DirectX-SDK-Samples\\C++\\Direct3D\\ShadowMap\\Debug\\"
]
}
It prints out the path as:
C:\Users\bo3bdar\AppData\Local\Programs\Microsoft VS Code
This is a minor problem, because I can always hard code the paths, but it would be nice-to-have if I could use relative paths.
I don't understand enough to fix this, but this sequence is the part that needs to either resolve path vars, or set working directory to the terminal.
if(taskDefinition.buildEvent.after_build_failure || taskDefinition.buildEvent.after_build_success){
let commands_failure=taskDefinition.buildEvent.after_build_failure;
let commands_success=taskDefinition.buildEvent.after_build_success;
terminal.event_after_build=(success)=>{
if(success && commands_success){
for (const cmd of commands_success) {
let result=ChildProcess.execSync(cmd);
terminal.emit(result.toString())
}
}else if(commands_failure)
for (const cmd of commands_failure) {
let result=ChildProcess.execSync(cmd);
terminal.emit(result.toString())
}
}
}
While setting up the tasks.json to build, I want to use the buildEvent:after_build_success to copy my output files for debugging.
However, the working directory is actually left at the shell default, which is the home directory for VSCode. When I set it as:
It prints out the path as:
This is a minor problem, because I can always hard code the paths, but it would be nice-to-have if I could use relative paths.
I don't understand enough to fix this, but this sequence is the part that needs to either resolve path vars, or set working directory to the terminal.