diff --git a/src/utils.ts b/src/utils.ts index 7bd476cc2..e04a31c9e 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1119,14 +1119,21 @@ export async function appendIdfAndToolsToPath(curWorkspace: vscode.Uri) { modifiedEnv[pathNameInEnv]; } - const extraPathsArray = customExtraVars[pathNameInEnv].split(path.delimiter); - for (let extraPath of extraPathsArray) { - if ( - modifiedEnv[pathNameInEnv] && - !modifiedEnv[pathNameInEnv].includes(extraPath) - ) { - modifiedEnv[pathNameInEnv] = - extraPath + path.delimiter + modifiedEnv[pathNameInEnv]; + if ( + customExtraVars[pathNameInEnv] && + customExtraVars[pathNameInEnv].length > 0 + ) { + const extraPathsArray = customExtraVars[pathNameInEnv].split( + path.delimiter + ); + for (let extraPath of extraPathsArray) { + if ( + modifiedEnv[pathNameInEnv] && + !modifiedEnv[pathNameInEnv].includes(extraPath) + ) { + modifiedEnv[pathNameInEnv] = + extraPath + path.delimiter + modifiedEnv[pathNameInEnv]; + } } } diff --git a/testFiles/testWorkspace/.vscode/settings.json b/testFiles/testWorkspace/.vscode/settings.json index 78f60b94a..96634cf04 100644 --- a/testFiles/testWorkspace/.vscode/settings.json +++ b/testFiles/testWorkspace/.vscode/settings.json @@ -3,11 +3,11 @@ "idf.espMdfPath": "/test/esp-mdf", "idf.port": "/serialport", "idf.openOcdConfigs": [ - "board/esp32-wrover-kit-3.3v.cfg" + "board/esp32-wrover-kit-3.3v.cfg" ], "idf.gitPath": "/usr/bin/git", "files.simpleDialog.enable": true, "window.dialogStyle": "custom", "idf.notificationMode": "Output", - "idf.showOnboardingOnInit": false, + "idf.showOnboardingOnInit": false } \ No newline at end of file