Skip to content
This repository was archived by the owner on Jun 13, 2021. It is now read-only.

Conditional Settings

Marcel Kloubert edited this page Jan 20, 2019 · 13 revisions

Many settings support an if property, which, when defined, executes (JavaScript) code to check if a condition matches or not.

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' ) "
            }
        ]
    }
}

The complete list of functions, modules and constants, can be found at the Executable Settings page.

Clone this wiki locally