This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Startups
Marcel Kloubert edited this page Jun 13, 2021
·
2 revisions
Startups are similar to Autostart in Windows.
They make it possible to define tasks, as scripts or shell commands, which are executed after a (new) workspace has been loaded (or its configuration has been changed).
Create a startup
section to the settings.json
file in the .vscode
sub folder of your workspace and add one or more entry:
{
"ego.power-tools": {
"startup": [
{
"type": "script",
"script": "my_startup.js"
}
]
}
}
For that example, create a my_startup.js
file in your .vscode
folder and use the following skeleton:
exports.execute = async (args) => {
// args => https://egomobile.github.io/vscode-powertools/api/interfaces/_contracts_.scriptcommandstartuparguments.html
// s. https://code.visualstudio.com/api/references/vscode-api
const vscode = args.require('vscode');
vscode.window.showInformationMessage(
'Hello, new workspace!'
);
};
Name | Description | Required? |
---|---|---|
if |
(JavaScript) Code that checks if startup is available or not. s. Conditional Settings | no |
importValues |
Defines a list of properties, which uses (external) values for itself. s. Import Settings | no |
platforms |
A list of one or more platform IDs, where the startup should be run on. s. process.platform | no |
type |
The type. Currently supports: script and shell . Default: shell
|
no |
Runs a Node.js based script file.
{
"ego.power-tools": {
"startup": [
{
"type": "script",
"script": "my_startup.js"
}
]
}
}
Name | Description | Required? |
---|---|---|
options |
Options for the script. | no |
script 1
|
The path to the script that should be invoked. Relative paths will be mapped to the .vscode sub folder of the workspace or the .vscode-powertools sub folder inside the current user's home directory. |
yes |
1 supports placeholders
Runs a shell command.
{
"ego.power-tools": {
"startup": [
{
"type": "shell",
"command": "git fetch"
}
]
}
}
Name | Description | Required? |
---|---|---|
command 1
|
The command that should be run. | no |
cwd 1
|
The working directory. Relative paths will be mapped to the workspace root folder. Default: (workspace root folder) | no |
silent |
Do not write result to output. Default: (true)
|
no |
wait |
Wait until command has been executed or not. Default: (true)
|
no |
1 supports placeholders
licensed under GDFL 1.3 - © Next.e.GO Mobile SE