Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple tasks for Visual Studio Code to deploy/retrieve/delete the currently opened file, or an entire folder, using Salesforce CLI force:source commands.
{
"version": "2.0.0",
"tasks": [
{
"label": "SFDX: Deploy Current File",
"type": "shell",
"command": "sfdx",
"args": [
"force:source:deploy",
"--sourcepath",
"${relativeFile}",
"--wait",
"10"
],
"group": "build",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "SFDX: Retrieve Current File",
"type": "shell",
"command": "sfdx",
"args": [
"force:source:retrieve",
"--sourcepath",
"${relativeFile}",
"--wait",
"10"
],
"group": "build",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "SFDX: Delete Current File",
"type": "shell",
"command": "sfdx",
"args": [
"force:source:delete",
"--sourcepath",
"${relativeFile}",
"--wait",
"10"
],
"group": "build",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "SFDX: Deploy Folder",
"type": "shell",
"command": "sfdx",
"args": [
"force:source:deploy",
"--sourcepath",
"${input:sourcePath}",
"--wait",
"10"
],
"group": "build",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "SFDX: Retrieve Folder",
"type": "shell",
"command": "sfdx",
"args": [
"force:source:retrieve",
"--sourcepath",
"${input:sourcePath}",
"--wait",
"10"
],
"group": "build",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "SFDX: Delete Folder",
"type": "shell",
"command": "sfdx",
"args": [
"force:source:delete",
"--sourcepath",
"${input:sourcePath}",
"--wait",
"10"
],
"group": "build",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
}
],
"inputs": [
{
"id": "sourcePath",
"type": "promptString",
"description": "Folder path to source metadata",
"default": "force-app"
}
]
}
@douglascayers

This comment has been minimized.

Copy link
Owner Author

@douglascayers douglascayers commented Feb 17, 2019

See https://go.microsoft.com/fwlink/?LinkId=733558 for the documentation about the tasks.json format.

@clinto-thomas

This comment has been minimized.

Copy link

@clinto-thomas clinto-thomas commented Jun 2, 2021

It's truly amazing .

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