Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the option to use custom paths for the platforms, packages, cache and projects directories and added the option to turn on/off telemetry #3974

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,38 @@
"default": null,
"description": "Custom PATH for the `platformio` command, if you prefer to use a custom version of PlatformIO Core. Fill in the result of the system terminal command `echo $PATH` (Unix) / `echo %PATH%` (Windows)."
},
"platformio-ide.platformsPATH": {
"type": [
"string",
"null"
],
"default": null,
"description": "Custom PATH for the platforms directory, it will be the value of the enviroment variable PLATFORMIO_PLATFORMS_DIR."
},
"platformio-ide.packagesPATH": {
"type": [
"string",
"null"
],
"default": null,
"description": "Custom PATH for the packages directory, it will be the value of the enviroment variable PLATFORMIO_PACKAGES_DIR."
},
"platformio-ide.cachePATH": {
"type": [
"string",
"null"
],
"default": null,
"description": "Custom PATH for the cache directory, it will be the value of the enviroment variable PLATFORMIO_CACHE_DIR."
},
"platformio-ide.projectsDirectoryPATH": {
"type": [
"string",
"null"
],
"default": null,
"description": "Custom PATH for the projects directory, it will be the value of the enviroment variable PLATFORMIO_SETTING_PROJECTS_DIR."
},
"platformio-ide.reopenSerialMonitorDelay": {
"type": "integer",
"default": 0,
Expand Down Expand Up @@ -793,6 +825,11 @@
"default": null,
"description": "Custom base URL of the Python Package Index (default `https://pypi.org/simple`)"
},
"platformio-ide.enableTelemetry": {
"type": "boolean",
"default": true,
"description": "Share minimal diagnostics and usage information to help us make PlatformIO better, more information: https://docs.platformio.org/en/latest/core/userguide/cmd_settings.html#setting-enable-telemetry."
},
"platformio-ide.toolbar": {
"description": "PlatformIO Toolbar",
"type": "array",
Expand Down
18 changes: 18 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,24 @@ class PlatformIOVSCodeExtension {
if (this.getConfiguration('customPyPiIndexUrl')) {
extraVars['PIP_INDEX_URL'] = this.getConfiguration('customPyPiIndexUrl');
}

// configure telemetry
extraVars['PLATFORMIO_SETTING_ENABLE_TELEMETRY'] = this.getConfiguration('enableTelemetry') ? 'yes' : 'no';

// configure custom paths
if (this.getConfiguration('platformsPATH')) {
extraVars['PLATFORMIO_PLATFORMS_DIR'] = this.getConfiguration('platformsPATH');
}
if (this.getConfiguration('packagesPATH')) {
extraVars['PLATFORMIO_PACKAGES_DIR'] = this.getConfiguration('packagesPATH');
}
if (this.getConfiguration('cachePATH')) {
extraVars['PLATFORMIO_CACHE_DIR'] = this.getConfiguration('cachePATH');
}
if (this.getConfiguration('projectsDirectoryPATH')) {
extraVars['PLATFORMIO_SETTING_PROJECTS_DIR'] = this.getConfiguration('projectsDirectoryPATH');
}

pioNodeHelpers.proc.patchOSEnviron({
caller: 'vscode',
extraPath: this.getConfiguration('customPATH'),
Expand Down