This repository has been archived by the owner on Jun 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Executable Settings
Marcel Kloubert edited this page Jan 20, 2019
·
17 revisions
Settings, like [if](Conditional Settings), execute JavaScript code, the time, when they are handled.
The following example, runs an npm install
on startup, only if node_modules
folder does not exist.
{
"ego.power-tools": {
"startup": [
{
"command": "npm install",
"if": " !$fs.existsSync( $v['workspaceRoot'] + '/node_modules' ) "
}
]
}
}
Keep in mind: Any code needs to be executed synchronously and does NOT support async patterns, like Promises!
All available values as key/value pair.
!$fs.existsSync( $v['workspaceRoot'] + '/node_modules' )
Can (also) access any module of that extension.
$r('moment')().format('YYYY-MM-DD') === '1979-09-05'
Name | Description |
---|---|
_ |
lodash |
$fs |
fs-extra |
$h |
vscode-helpers |
$m |
Moment.js with timezone support |
$p |
Node.js path module |
$vs |
Visual Studio Code API |
licensed under GDFL 1.3 - © e.GO Digital GmbH