Skip to content

Instantly share code, notes, and snippets.

@Jaid
Last active December 19, 2023 04:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jaid/360fbcee49572c5672feefdc9469281f to your computer and use it in GitHub Desktop.
Save Jaid/360fbcee49572c5672feefdc9469281f to your computer and use it in GitHub Desktop.
VSCode tasks.json snippets

VSCode tasks.json snippets for Windows

Used environment variables

Variable Provider Example
ProgramW6432 Windows C:\Program Files
NVM_SYMLINK nvm C:\Users\USER\AppData\Local\nvm\used
reposFolder C:/Users/USER/git
foreignReposFolder C:/Users/USER/git/.foreign
globalNodeModules C:/USER/git/node_modules
{
"label": "script: ports",
"command": "${env:foreignReposFolder}/scripts/bin/ports",
"options": {
"shell": {
"executable": "bash"
}
},
"windows": {
"options": {
"shell": {
"executable": "${env:foreignReposFolder}/scripts/bin/ports.bat"
}
}
},
"runOptions": {
"instanceLimit": 1
},
"type": "shell",
"presentation": {
"reveal": "silent",
"showReuseMessage": false
}
}
{
"label": "npx: fse-cli-mkdirs",
"command": "${env:globalNodeModules}/.bin/fse-cli-mkdirs",
"options": {
"shell": {
"executable": "bash"
}
},
"windows": {
"options": {
"shell": {
"executable": "${env:ProgramW6432}/PowerShell/7/pwsh.exe",
"args": [
"-File"
]
}
},
"command": "${env:globalNodeModules}/.bin/fse-cli-mkdirs.ps1"
},
"args": [
"${input:newFolderName}"
],
"runOptions": {
"instanceLimit": 1
},
"type": "shell",
"presentation": {
"reveal": "silent",
"showReuseMessage": false
}
}
{
"label": "startRepo: ln-folder-version",
"command": "--prefix ${env:reposFolder}/ln-folder-version start",
"options": {
"shell": {
"executable": "${env:NVM_SYMLINK}/npm"
}
},
"windows": {
"options": {
"shell": {
"executable": "${env:NVM_SYMLINK}/npm.cmd"
}
}
},
"runOptions": {
"instanceLimit": 1
},
"type": "shell",
"presentation": {
"reveal": "silent",
"showReuseMessage": false
}
}
{
"label": "npm: add",
"command": "install --save ${input:packageName}",
"options": {
"shell": {
"executable": "${env:NVM_SYMLINK}/npm"
}
},
"windows": {
"options": {
"shell": {
"executable": "${env:NVM_SYMLINK}/npm.cmd"
}
}
},
"runOptions": {
"instanceLimit": 1
},
"type": "shell",
"presentation": {
"reveal": "silent",
"showReuseMessage": false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment