From a98c7fb6ebdd3393e7f2ebecee913c74e6d6943e Mon Sep 17 00:00:00 2001 From: Radu Date: Thu, 29 Feb 2024 17:59:59 +0200 Subject: [PATCH 01/18] :bug: Replace ShellExcecution -> ProcessExecution - Replaced Shell Executions task type with Process Executions - Modified a bit the code for consistency in the project (replacing, workspace variable name to workspaceUri because there is a vscode.workspace an this two can be confused if we import "workspace" from "vscode" specifically. --- src/build/buildTask.ts | 153 +++++++++----------------- src/customTasks/customTaskProvider.ts | 81 ++++++-------- src/espBom/index.ts | 42 +++---- src/espIdf/size/idfSizeTask.ts | 64 ++++------- src/flash/dfu.ts | 8 +- src/flash/flashTask.ts | 87 ++++++++------- 6 files changed, 179 insertions(+), 256 deletions(-) diff --git a/src/build/buildTask.ts b/src/build/buildTask.ts index ff6e4753b..f99d00708 100644 --- a/src/build/buildTask.ts +++ b/src/build/buildTask.ts @@ -28,23 +28,35 @@ import { selectedDFUAdapterId } from "../flash/dfu"; export class BuildTask { public static isBuilding: boolean; private buildDirPath: string; - private curWorkspace: vscode.Uri; + private currentWorkspace: vscode.Uri; private idfPathDir: string; private adapterTargetName: string; + private processOptions: vscode.ProcessExecutionOptions; + private modifiedEnv: { [key: string]: string }; + private pythonBinPath: string; - constructor(workspace: vscode.Uri) { - this.curWorkspace = workspace; + constructor(workspaceUri: vscode.Uri) { + this.currentWorkspace = workspaceUri; this.idfPathDir = idfConf.readParameter( "idf.espIdfPath", - workspace + workspaceUri ) as string; this.adapterTargetName = idfConf.readParameter( "idf.adapterTargetName", - workspace + workspaceUri ) as string; this.buildDirPath = idfConf.readParameter( "idf.buildPath", - workspace + workspaceUri + ) as string; + this.modifiedEnv = appendIdfAndToolsToPath(workspaceUri); + this.processOptions = { + cwd: this.buildDirPath, + env: this.modifiedEnv, + }; + this.pythonBinPath = idfConf.readParameter( + "idf.pythonBinPath", + workspaceUri ) as string; } @@ -55,45 +67,13 @@ export class BuildTask { private async saveBeforeBuild() { const shallSaveBeforeBuild = idfConf.readParameter( "idf.saveBeforeBuild", - this.curWorkspace + this.currentWorkspace ); if (shallSaveBeforeBuild) { await vscode.workspace.saveAll(); } } - public getShellExecution( - args: string[], - options?: vscode.ShellExecutionOptions - ) { - return new vscode.ShellExecution(`cmake ${args.join(" ")}`, options); - } - - public getNinjaShellExecution( - args: string[], - options?: vscode.ShellExecutionOptions - ) { - return new vscode.ShellExecution(`ninja ${args.join(" ")}`, options); - } - - public dfuShellExecution(options?: vscode.ShellExecutionOptions) { - const pythonBinPath = idfConf.readParameter( - "idf.pythonBinPath", - this.curWorkspace - ) as string; - return new vscode.ShellExecution( - `${pythonBinPath} ${join( - this.idfPathDir, - "tools", - "mkdfu.py" - )} write -o ${join(this.buildDirPath, "dfu.bin")} --json ${join( - this.buildDirPath, - "flasher_args.json" - )} --pid ${selectedDFUAdapterId(this.adapterTargetName)}`, - options - ); - } - public async build() { try { await this.saveBeforeBuild(); @@ -107,17 +87,16 @@ export class BuildTask { throw new Error("ALREADY_BUILDING"); } this.building(true); - const modifiedEnv = appendIdfAndToolsToPath(this.curWorkspace); await ensureDir(this.buildDirPath); const canAccessCMake = await isBinInPath( "cmake", - this.curWorkspace.fsPath, - modifiedEnv + this.currentWorkspace.fsPath, + this.modifiedEnv ); const canAccessNinja = await isBinInPath( "ninja", - this.curWorkspace.fsPath, - modifiedEnv + this.currentWorkspace.fsPath, + this.modifiedEnv ); const cmakeCachePath = join(this.buildDirPath, "CMakeCache.txt"); @@ -127,33 +106,13 @@ export class BuildTask { throw new Error("CMake or Ninja executables not found"); } - const options: vscode.ShellExecutionOptions = { - cwd: this.buildDirPath, - env: modifiedEnv, - }; - const shellExecutablePath = idfConf.readParameter( - "idf.customTerminalExecutable", - this.curWorkspace - ) as string; - const shellExecutableArgs = idfConf.readParameter( - "idf.customTerminalExecutableArgs", - this.curWorkspace - ) as string[]; - if (shellExecutablePath) { - options.executable = shellExecutablePath; - } - - if (shellExecutableArgs && shellExecutableArgs.length) { - options.shellArgs = shellExecutableArgs; - } - - const curWorkspaceFolder = vscode.workspace.workspaceFolders.find( - (w) => w.uri === this.curWorkspace + const currentWorkspaceFolder = vscode.workspace.workspaceFolders.find( + (w) => w.uri === this.currentWorkspace ); const notificationMode = idfConf.readParameter( "idf.notificationMode", - this.curWorkspace + this.currentWorkspace ) as string; const showTaskOutput = notificationMode === idfConf.NotificationMode.All || @@ -164,7 +123,7 @@ export class BuildTask { if (!cmakeCacheExists) { let compilerArgs = (idfConf.readParameter( "idf.cmakeCompilerArgs", - this.curWorkspace + this.currentWorkspace ) as Array) || [ "-G", "Ninja", @@ -178,7 +137,7 @@ export class BuildTask { compilerArgs.push("-B", this.buildDirPath); if (compilerArgs.indexOf("-S") === -1) { - compilerArgs.push("-S", this.curWorkspace.fsPath); + compilerArgs.push("-S", this.currentWorkspace.fsPath); } const sdkconfigDefaults = @@ -196,7 +155,7 @@ export class BuildTask { const enableCCache = idfConf.readParameter( "idf.enableCCache", - this.curWorkspace + this.currentWorkspace ) as boolean; if (enableCCache && compilerArgs && compilerArgs.length) { const indexOfCCache = compilerArgs.indexOf("-DCCACHE_ENABLE=1"); @@ -204,7 +163,8 @@ export class BuildTask { compilerArgs.push("-DCCACHE_ENABLE=1"); } } - const compileExecution = this.getShellExecution(compilerArgs, options); + const cmakeCommand = "cmake"; + const compileExecution = new vscode.ProcessExecution(cmakeCommand, compilerArgs, this.processOptions); const compilePresentationOptions = { reveal: showTaskOutput, showReuseMessage: false, @@ -217,7 +177,7 @@ export class BuildTask { command: "ESP-IDF Compile", taskId: "idf-compile-task", }, - curWorkspaceFolder || vscode.TaskScope.Workspace, + currentWorkspaceFolder || vscode.TaskScope.Workspace, "ESP-IDF Compile", compileExecution, ["espIdf"], @@ -227,10 +187,11 @@ export class BuildTask { } const buildArgs = - (idfConf.readParameter("idf.ninjaArgs", this.curWorkspace) as Array< + (idfConf.readParameter("idf.ninjaArgs", this.currentWorkspace) as Array< string >) || []; - const buildExecution = this.getNinjaShellExecution(buildArgs, options); + const ninjaCommand = "ninja"; + const buildExecution = new vscode.ProcessExecution(ninjaCommand, buildArgs, this.processOptions); const buildPresentationOptions = { reveal: showTaskOutput, showReuseMessage: false, @@ -239,7 +200,7 @@ export class BuildTask { } as vscode.TaskPresentationOptions; TaskManager.addTask( { type: "esp-idf", command: "ESP-IDF Build", taskId: "idf-build-task" }, - curWorkspaceFolder || vscode.TaskScope.Workspace, + currentWorkspaceFolder || vscode.TaskScope.Workspace, "ESP-IDF Build", buildExecution, ["espIdf"], @@ -249,36 +210,16 @@ export class BuildTask { public async buildDfu() { this.building(true); - const modifiedEnv = appendIdfAndToolsToPath(this.curWorkspace); + const modifiedEnv = appendIdfAndToolsToPath(this.currentWorkspace); await ensureDir(this.buildDirPath); - const options: vscode.ShellExecutionOptions = { - cwd: this.curWorkspace.fsPath, - env: modifiedEnv, - }; - - const shellExecutablePath = idfConf.readParameter( - "idf.customTerminalExecutable", - this.curWorkspace - ) as string; - const shellExecutableArgs = idfConf.readParameter( - "idf.customTerminalExecutableArgs", - this.curWorkspace - ) as string[]; - if (shellExecutablePath) { - options.executable = shellExecutablePath; - } - if (shellExecutableArgs && shellExecutableArgs.length) { - options.shellArgs = shellExecutableArgs; - } - - const curWorkspaceFolder = vscode.workspace.workspaceFolders.find( - (w) => w.uri === this.curWorkspace + const currentWorkspaceFolder = vscode.workspace.workspaceFolders.find( + (w) => w.uri === this.currentWorkspace ); const notificationMode = idfConf.readParameter( "idf.notificationMode", - this.curWorkspace + this.currentWorkspace ) as string; const showTaskOutput = notificationMode === idfConf.NotificationMode.All || @@ -286,7 +227,17 @@ export class BuildTask { ? vscode.TaskRevealKind.Always : vscode.TaskRevealKind.Silent; - const writeExecution = this.dfuShellExecution(options); + const args = [ + join(this.idfPathDir, "tools", "mkdfu.py"), + "write", + "-o", + join(this.buildDirPath, "dfu.bin"), + "--json", + join(this.buildDirPath, "flasher_args.json"), + "--pid", + selectedDFUAdapterId(this.adapterTargetName) + ]; + const writeExecution = new vscode.ProcessExecution(this.pythonBinPath, args, this.processOptions); const buildPresentationOptions = { reveal: showTaskOutput, showReuseMessage: false, @@ -299,7 +250,7 @@ export class BuildTask { command: "ESP-IDF Write DFU.bin", taskId: "idf-write-dfu-task", }, - curWorkspaceFolder || vscode.TaskScope.Workspace, + currentWorkspaceFolder || vscode.TaskScope.Workspace, "ESP-IDF Write DFU.bin", writeExecution, ["espIdf"], diff --git a/src/customTasks/customTaskProvider.ts b/src/customTasks/customTaskProvider.ts index acffaa10c..5c071536f 100644 --- a/src/customTasks/customTaskProvider.ts +++ b/src/customTasks/customTaskProvider.ts @@ -17,8 +17,8 @@ */ import { - ShellExecution, - ShellExecutionOptions, + ProcessExecution, + ProcessExecutionOptions, TaskPanelKind, TaskPresentationOptions, TaskRevealKind, @@ -40,68 +40,57 @@ export enum CustomTaskType { export class CustomTask { public static isRunningCustomTask: boolean; + private processOptions: ProcessExecutionOptions; + private buildDirPath: string; + private currentWorkspace: Uri; + private modifiedEnv: { [key: string]: string }; - constructor(private currentWorkspace: Uri) {} + constructor(private workspaceUri: Uri) { + this.currentWorkspace = workspaceUri; + this.buildDirPath = readParameter( + "idf.buildPath", + this.currentWorkspace + ) as string; + this.modifiedEnv = appendIdfAndToolsToPath(workspaceUri); + this.processOptions = { + cwd: this.buildDirPath, + env: this.modifiedEnv, + }; + } public isRunning(flag: boolean) { CustomTask.isRunningCustomTask = flag; } - public getProcessExecution( - cmdString: string, - options: ShellExecutionOptions - ) { - return new ShellExecution(`${cmdString}`, options); - } - public addCustomTask(taskType: CustomTaskType) { - let cmd: string; + let command: string; let taskName: string; switch (taskType) { case CustomTaskType.PreBuild: - cmd = readParameter("idf.preBuildTask", this.currentWorkspace); + command = readParameter("idf.preBuildTask", this.currentWorkspace); taskName = "Pre Build"; break; case CustomTaskType.PostBuild: - cmd = readParameter("idf.postBuildTask", this.currentWorkspace); + command = readParameter("idf.postBuildTask", this.currentWorkspace); taskName = "Post Build"; break; case CustomTaskType.PreFlash: - cmd = readParameter("idf.preFlashTask", this.currentWorkspace); + command = readParameter("idf.preFlashTask", this.currentWorkspace); taskName = "Pre Flash"; break; case CustomTaskType.PostFlash: - cmd = readParameter("idf.postFlashTask", this.currentWorkspace); + command = readParameter("idf.postFlashTask", this.currentWorkspace); taskName = "Post Flash"; break; case CustomTaskType.Custom: - cmd = readParameter("idf.customTask", this.currentWorkspace); + command = readParameter("idf.customTask", this.currentWorkspace); taskName = "Custom task"; default: break; } - if (!cmd) { + if (!command) { return; } - const modifiedEnv = appendIdfAndToolsToPath(this.currentWorkspace); - const options: ShellExecutionOptions = { - cwd: this.currentWorkspace.fsPath, - env: modifiedEnv, - }; - const shellExecutablePath = readParameter( - "idf.customTerminalExecutable", - this.currentWorkspace - ) as string; - const shellExecutableArgs = readParameter( - "idf.customTerminalExecutableArgs", - this.currentWorkspace - ) as string[]; - if (shellExecutablePath) { - options.executable = shellExecutablePath; - } - if (shellExecutableArgs && shellExecutableArgs.length) { - options.shellArgs = shellExecutableArgs; - } const notificationMode = readParameter( "idf.notificationMode", this.currentWorkspace @@ -111,14 +100,14 @@ export class CustomTask { notificationMode === NotificationMode.Output ? TaskRevealKind.Always : TaskRevealKind.Silent; - const customExecution = this.getProcessExecution(cmd, options); + const customExecution = new ProcessExecution(command, this.processOptions); const customTaskPresentationOptions = { reveal: showTaskOutput, showReuseMessage: false, clear: false, panel: TaskPanelKind.Dedicated, } as TaskPresentationOptions; - const curWorkspaceFolder = workspace.workspaceFolders.find( + const currentWorkspaceFolder = workspace.workspaceFolders.find( (w) => w.uri === this.currentWorkspace ); TaskManager.addTask( @@ -127,7 +116,7 @@ export class CustomTask { command: `ESP-IDF ${taskName}`, taskId: `idf-${taskType}-task`, }, - curWorkspaceFolder || TaskScope.Workspace, + currentWorkspaceFolder || TaskScope.Workspace, `ESP-IDF ${taskName}`, customExecution, ["espIdf"], @@ -136,38 +125,38 @@ export class CustomTask { } public async runTasks(taskType: CustomTaskType) { - let cmd: string; + let command: string; switch (taskType) { case CustomTaskType.PreBuild: - cmd = readParameter( + command = readParameter( "idf.preBuildTask", this.currentWorkspace ) as string; break; case CustomTaskType.PostBuild: - cmd = readParameter( + command = readParameter( "idf.postBuildTask", this.currentWorkspace ) as string; break; case CustomTaskType.PreFlash: - cmd = readParameter( + command = readParameter( "idf.preFlashTask", this.currentWorkspace ) as string; break; case CustomTaskType.PostFlash: - cmd = readParameter( + command = readParameter( "idf.postFlashTask", this.currentWorkspace ) as string; break; case CustomTaskType.Custom: - cmd = readParameter("idf.customTask", this.currentWorkspace) as string; + command = readParameter("idf.customTask", this.currentWorkspace) as string; default: break; } - if (cmd) { + if (command) { await TaskManager.runTasks(); } } diff --git a/src/espBom/index.ts b/src/espBom/index.ts index 4bdc44776..367f4acb2 100644 --- a/src/espBom/index.ts +++ b/src/espBom/index.ts @@ -23,8 +23,8 @@ import { TaskPanelKind, TaskPresentationOptions, TaskScope, - ShellExecutionOptions, - ShellExecution, + ProcessExecutionOptions, + ProcessExecution, } from "vscode"; import { appendIdfAndToolsToPath, @@ -66,24 +66,10 @@ export async function createSBOM(workspaceUri: Uri) { ); } } - const options: ShellExecutionOptions = { + const options: ProcessExecutionOptions = { cwd: workspaceUri.fsPath, env: modifiedEnv, }; - const shellExecutablePath = readParameter( - "idf.customTerminalExecutable", - workspaceUri - ) as string; - const shellExecutableArgs = readParameter( - "idf.customTerminalExecutableArgs", - workspaceUri - ) as string[]; - if (shellExecutablePath) { - options.executable = shellExecutablePath; - } - if (shellExecutableArgs && shellExecutableArgs.length) { - options.shellArgs = shellExecutableArgs; - } const notificationMode = readParameter( "idf.notificationMode", workspaceUri @@ -102,14 +88,20 @@ export async function createSBOM(workspaceUri: Uri) { clear: false, panel: TaskPanelKind.Shared, } as TaskPresentationOptions; - const sbomCreateExecution = new ShellExecution( - `esp-idf-sbom create ${projectDescriptionJson} --output-file ${sbomFilePath}`, - options - ); - const sbomCheckExecution = new ShellExecution( - `esp-idf-sbom check ${sbomFilePath}`, - options - ); + const command = "esp-idf-sbnom"; + const argsCreating = [ + "create", + projectDescriptionJson, + "--output-file", + sbomFilePath + ]; + const sbomCreateExecution = new ProcessExecution(command, argsCreating, options); + + const argsChecking = [ + "check", + sbomFilePath, + ]; + const sbomCheckExecution = new ProcessExecution(command, argsChecking, options); TaskManager.addTask( { type: "esp-idf", diff --git a/src/espIdf/size/idfSizeTask.ts b/src/espIdf/size/idfSizeTask.ts index c066b2dbb..9e6ef8cad 100644 --- a/src/espIdf/size/idfSizeTask.ts +++ b/src/espIdf/size/idfSizeTask.ts @@ -19,14 +19,14 @@ import { ensureDir } from "fs-extra"; import { join } from "path"; import { - ShellExecution, - ShellExecutionOptions, TaskPanelKind, + ProcessExecutionOptions, TaskPresentationOptions, TaskRevealKind, TaskScope, Uri, workspace, + ProcessExecution } from "vscode"; import { NotificationMode, readParameter } from "../../idfConfiguration"; import { TaskManager } from "../../taskManager"; @@ -34,28 +34,27 @@ import { appendIdfAndToolsToPath } from "../../utils"; import { getProjectName } from "../../workspaceConfig"; export class IdfSizeTask { - private curWorkspace: Uri; + private currentWorkspace: Uri; private pythonBinPath: string; private idfSizePath: string; private buildDirPath: string; + private processOptions: ProcessExecutionOptions; + private modifiedEnv: { [key: string]: string }; - constructor(workspacePath: Uri) { - this.curWorkspace = workspacePath; + constructor(workspaceUri: Uri) { + this.currentWorkspace = workspaceUri; this.pythonBinPath = readParameter( "idf.pythonBinPath", - workspacePath + workspaceUri ) as string; - const idfPathDir = readParameter("idf.espIdfPath", workspacePath) as string; + const idfPathDir = readParameter("idf.espIdfPath", workspaceUri) as string; this.idfSizePath = join(idfPathDir, "tools", "idf_size.py"); - this.buildDirPath = readParameter("idf.buildPath", workspacePath) as string; - } - - public async getShellExecution(options: ShellExecutionOptions) { - const mapFilePath = await this.mapFilePath(); - return new ShellExecution( - `${this.pythonBinPath} ${this.idfSizePath} ${mapFilePath}`, - options - ); + this.buildDirPath = readParameter("idf.buildPath", workspaceUri) as string; + this.modifiedEnv = appendIdfAndToolsToPath(this.currentWorkspace); + this.processOptions = { + cwd: this.buildDirPath, + env: this.modifiedEnv, + }; } private async mapFilePath() { @@ -64,33 +63,18 @@ export class IdfSizeTask { } public async getSizeInfo() { - const modifiedEnv = appendIdfAndToolsToPath(this.curWorkspace); await ensureDir(this.buildDirPath); - const options: ShellExecutionOptions = { - cwd: this.curWorkspace.fsPath, - env: modifiedEnv, - }; - const shellExecutablePath = readParameter( - "idf.customTerminalExecutable", - this.curWorkspace - ) as string; - const shellExecutableArgs = readParameter( - "idf.customTerminalExecutableArgs", - this.curWorkspace - ) as string[]; - if (shellExecutablePath) { - options.executable = shellExecutablePath; - } - if (shellExecutableArgs && shellExecutableArgs.length) { - options.shellArgs = shellExecutableArgs; - } - const sizeExecution = await this.getShellExecution(options); + const pythonCommand = this.pythonBinPath; + const mapFilePath = await this.mapFilePath(); + const args = [this.idfSizePath, mapFilePath]; + + const sizeExecution = new ProcessExecution(pythonCommand, args, this.processOptions); const notificationMode = readParameter( "idf.notificationMode", - this.curWorkspace + this.currentWorkspace ) as string; - const curWorkspaceFolder = workspace.workspaceFolders.find( - (w) => w.uri === this.curWorkspace + const currentWorkspaceFolder = workspace.workspaceFolders.find( + (w) => w.uri === this.currentWorkspace ); const showTaskOutput = notificationMode === NotificationMode.All || @@ -105,7 +89,7 @@ export class IdfSizeTask { } as TaskPresentationOptions; TaskManager.addTask( { type: "esp-idf", command: "ESP-IDF Size", taskId: "idf-size-task" }, - curWorkspaceFolder || TaskScope.Workspace, + currentWorkspaceFolder || TaskScope.Workspace, "ESP-IDF Size", sizeExecution, ["espIdf"], diff --git a/src/flash/dfu.ts b/src/flash/dfu.ts index d383d625f..6f3a7c0a2 100644 --- a/src/flash/dfu.ts +++ b/src/flash/dfu.ts @@ -64,14 +64,14 @@ export async function listAvailableDfuDevices(text) { * @param {string} chip - String to identify the chip (IDF_TARGET) * @returns {number} PID Number for DFU */ - export function selectedDFUAdapterId(chip: string): number { + export function selectedDFUAdapterId(chip: string): string { switch (chip) { case "esp32s2": - return 2; + return "2"; case "esp32s3": - return 9; + return "9"; default: - return -1; + return "-1"; } } diff --git a/src/flash/flashTask.ts b/src/flash/flashTask.ts index 7cd6f7a48..8d58f83fc 100644 --- a/src/flash/flashTask.ts +++ b/src/flash/flashTask.ts @@ -28,19 +28,23 @@ import { ESP } from "../config"; export class FlashTask { public static isFlashing: boolean; - private workspaceUri: vscode.Uri; + private currentWorkspace: vscode.Uri; private flashScriptPath: string; private model: FlashModel; private buildDirPath: string; private encryptPartitions: boolean; + private idfPathDir: string; + private pythonBinPath: string; + private modifiedEnv: { [key: string]: string }; + private processOptions: vscode.ProcessExecutionOptions; constructor( - workspace: vscode.Uri, + workspaceUri: vscode.Uri, idfPath: string, model: FlashModel, - encryptPartitions: boolean + encryptPartitions: boolean, ) { - this.workspaceUri = workspace; + this.currentWorkspace = workspaceUri; this.flashScriptPath = join( idfPath, "components", @@ -51,9 +55,22 @@ export class FlashTask { this.model = model; this.buildDirPath = idfConf.readParameter( "idf.buildPath", - workspace + workspaceUri ) as string; this.encryptPartitions = encryptPartitions; + this.idfPathDir = idfConf.readParameter( + "idf.espIdfPath", + this.currentWorkspace + ) as string; + this.pythonBinPath = idfConf.readParameter( + "idf.pythonBinPath", + this.currentWorkspace + ) as string; + this.modifiedEnv = appendIdfAndToolsToPath(workspaceUri); + this.processOptions = { + cwd: this.buildDirPath, + env: this.modifiedEnv, + }; } public flashing(flag: boolean) { @@ -83,17 +100,17 @@ export class FlashTask { this.verifyArgs(); const notificationMode = idfConf.readParameter( "idf.notificationMode", - this.workspaceUri + this.currentWorkspace ) as string; - const curWorkspaceFolder = vscode.workspace.workspaceFolders.find( - (w) => w.uri === this.workspaceUri + const currentWorkspaceFolder = vscode.workspace.workspaceFolders.find( + (w) => w.uri === this.currentWorkspace ); const showTaskOutput = notificationMode === idfConf.NotificationMode.All || notificationMode === idfConf.NotificationMode.Output ? vscode.TaskRevealKind.Always : vscode.TaskRevealKind.Silent; - let flashExecution: vscode.ShellExecution | vscode.ProcessExecution; + let flashExecution: vscode.ProcessExecution; switch (flashType) { case "UART": flashExecution = this._flashExecution(); @@ -112,7 +129,7 @@ export class FlashTask { } as vscode.TaskPresentationOptions; TaskManager.addTask( { type: "esp-idf", command: "ESP-IDF Flash", taskId: "idf-flash-task" }, - curWorkspaceFolder || vscode.TaskScope.Workspace, + currentWorkspaceFolder || vscode.TaskScope.Workspace, "ESP-IDF Flash", flashExecution, ["espIdf"], @@ -122,49 +139,39 @@ export class FlashTask { public _flashExecution() { this.flashing(true); - const modifiedEnv = appendIdfAndToolsToPath(this.workspaceUri); const flasherArgs = this.getFlasherArgs(this.flashScriptPath); - const options: vscode.ShellExecutionOptions = { - cwd: this.buildDirPath, - env: modifiedEnv, - }; - const pythonBinPath = idfConf.readParameter( - "idf.pythonBinPath", - this.workspaceUri - ) as string; - return new vscode.ProcessExecution(pythonBinPath, flasherArgs, options); + return new vscode.ProcessExecution(this.pythonBinPath, flasherArgs, this.processOptions); } public _dfuFlashing() { this.flashing(true); const selectedDfuPath = idfConf.readParameter( "idf.selectedDfuDevicePath", - this.workspaceUri + this.currentWorkspace ); const listDfuDevices = idfConf.readParameter( "idf.listDfuDevices", - this.workspaceUri + this.currentWorkspace ); if (listDfuDevices.length > 1) { - const idfPathDir = idfConf.readParameter( - "idf.espIdfPath", - this.workspaceUri - ) as string; - const pythonPath = idfConf.readParameter( - "idf.pythonBinPath", - this.workspaceUri - ) as string; - const idfPy = path.join(idfPathDir, "tools", "idf.py"); - return new vscode.ShellExecution( - `${pythonPath} ${idfPy} dfu-flash --path ${selectedDfuPath}` - ); + const pythonCommand = this.pythonBinPath; + const idfPy = path.join(this.idfPathDir, "tools", "idf.py"); + const args = [ + idfPy, + 'dfu-flash', + '--path', + selectedDfuPath + ]; + return new vscode.ProcessExecution(pythonCommand, args, this.processOptions); } - return new vscode.ShellExecution( - `dfu-util -d 303a:${selectedDFUAdapterId(this.model.chip)} -D ${join( - this.buildDirPath, - "dfu.bin" - )}` - ); + const dfuCommand = "dfu-util"; + const args = [ + "-d", + `303a:${Number(selectedDFUAdapterId(this.model.chip)).toString(16)}`, + "-D", + join(this.buildDirPath, "dfu.bin") + ]; + return new vscode.ProcessExecution(dfuCommand, args, this.processOptions); } public getFlasherArgs(toolPath: string, replacePathSep: boolean = false) { From 9c95d7bd162f0c81cd19d75d0af41ab173040b8d Mon Sep 17 00:00:00 2001 From: Radu Date: Fri, 1 Mar 2024 13:24:52 +0200 Subject: [PATCH 02/18] Update variable name From workspace to workspaceUri --- src/flash/dfu.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/flash/dfu.ts b/src/flash/dfu.ts index 6f3a7c0a2..f7b38b074 100644 --- a/src/flash/dfu.ts +++ b/src/flash/dfu.ts @@ -31,8 +31,8 @@ function deviceLabel(selectedDevice: string) { return "ESP32-S3"; } -export async function getDfuList(workspace: vscode.Uri) { - const modifiedEnv = appendIdfAndToolsToPath(workspace); +export async function getDfuList(workspaceUri: vscode.Uri) { + const modifiedEnv = appendIdfAndToolsToPath(workspaceUri); return await execChildProcess( "dfu-util --list", process.cwd(), From eb39c3155b286ac1417c2756627451e45fd8a940 Mon Sep 17 00:00:00 2001 From: Radu Date: Mon, 4 Mar 2024 13:48:32 +0200 Subject: [PATCH 03/18] Removing validations for whitespaces TODO: UI changes to let user know it only work on version of esp-idf 5.0 and higher --- src/setup/SetupPanel.ts | 46 ----------------------- src/views/setup/App.vue | 8 +++- src/views/setup/components/folderOpen.vue | 2 +- 3 files changed, 7 insertions(+), 49 deletions(-) diff --git a/src/setup/SetupPanel.ts b/src/setup/SetupPanel.ts index 0259ddef8..448386c4a 100644 --- a/src/setup/SetupPanel.ts +++ b/src/setup/SetupPanel.ts @@ -436,16 +436,6 @@ export class SetupPanel { idfGitPath = embedPaths.idfGitPath; idfPythonPath = embedPaths.idfPythonPath; } - const pathToCheck = - selectedIdfVersion.filename === "manual" - ? espIdfPath - : idfContainerPath; - this.checkSpacesInPaths( - pathToCheck, - toolsPath, - idfGitPath, - idfPythonPath - ); await expressInstall( selectedIdfVersion, idfPythonPath, @@ -575,12 +565,6 @@ export class SetupPanel { idfGitPath = embedPaths.idfGitPath; idfPythonPath = embedPaths.idfPythonPath; } - this.checkSpacesInPaths( - idfPath, - toolsPath, - idfGitPath, - idfPythonPath - ); await downloadIdfTools( idfPath, toolsPath, @@ -694,36 +678,6 @@ export class SetupPanel { return { idfPythonPath, idfGitPath }; } - private checkSpacesInPaths( - idfPath: string, - idfToolsPath: string, - gitPath: string, - pythonBinPath: string - ) { - const doesIdfPathHasSpaces = checkSpacesInPath(idfPath); - const doesIdfToolsPathHasSpaces = checkSpacesInPath(idfToolsPath); - const doesGitPathHasSpaces = checkSpacesInPath(gitPath); - const doesPythonBinPath = checkSpacesInPath(pythonBinPath); - let pathHasSpaces = ""; - if (doesIdfPathHasSpaces) { - pathHasSpaces = `${idfPath} has spaces. Use another location. (IDF_PATH_WITH_SPACES)`; - } - if (doesIdfToolsPathHasSpaces) { - pathHasSpaces = `${idfToolsPath} has spaces. Use another location. (IDF_TOOLS_PATH_WITH_SPACES)`; - } - if (doesGitPathHasSpaces) { - pathHasSpaces = `${gitPath} has spaces. Use another location. (GIT_PATH_WITH_SPACES)`; - } - if (doesPythonBinPath) { - pathHasSpaces = `${pythonBinPath} has spaces. Use another location. (PYTHON_BIN_PATH_WITH_SPACES)`; - } - if (pathHasSpaces) { - OutputChannel.appendLine(pathHasSpaces); - Logger.infoNotify(pathHasSpaces); - throw new Error(pathHasSpaces); - } - } - private async getOpenOcdRulesPath() { try { await getOpenOcdRules(Uri.file(this.context.extensionPath)); diff --git a/src/views/setup/App.vue b/src/views/setup/App.vue index 9645e602c..209997cfd 100644 --- a/src/views/setup/App.vue +++ b/src/views/setup/App.vue @@ -21,7 +21,7 @@ const isLinuxPlatform = computed(() => { const openOCDRulesPathText = computed(() => { return openOCDRulesPath.value !== "" - ? `sudo cp -n ${openOCDRulesPath.value} /etc/udev/rules.d` + ? `sudo cp -n "${openOCDRulesPath.value}" /etc/udev/rules.d` : ""; }); @@ -66,7 +66,7 @@ const openOCDRulesPathText = computed(() => {

Run this command in a terminal with sudo privileges:

-
+
{{ openOCDRulesPathText }}
@@ -118,4 +118,8 @@ const openOCDRulesPathText = computed(() => { .span-path { color: var(--vscode-button-hoverBackground); } + +.keep-spaces { + white-space: pre-wrap; +} diff --git a/src/views/setup/components/folderOpen.vue b/src/views/setup/components/folderOpen.vue index 43bfd233f..9dd0572b9 100644 --- a/src/views/setup/components/folderOpen.vue +++ b/src/views/setup/components/folderOpen.vue @@ -34,7 +34,7 @@ function onKeyEnter() { -./types \ No newline at end of file +./types + + \ No newline at end of file diff --git a/src/views/setup/Install.vue b/src/views/setup/Install.vue index ffc796edf..3498f5dfe 100644 --- a/src/views/setup/Install.vue +++ b/src/views/setup/Install.vue @@ -11,14 +11,19 @@ import { IconClose } from "@iconify-prerendered/vue-codicon"; const store = useSetupStore(); const { - espIdfErrorStatus, gitVersion, pathSep, pyExecErrorStatus, toolsFolder, setupMode, + selectedEspIdfVersion, + espIdf, + espIdfContainer } = storeToRefs(store); +const errMsgIdf = "The ESP IDF folder path cannot contain spaces for ESP-IDF version lower than 5.0"; +const errMsgTools = "The ESP Tools folder path cannot contain spaces for ESP-IDF version lower than 5.0"; + const isNotWinPlatform = computed(() => { return pathSep.value.indexOf("/") !== -1; }); @@ -27,9 +32,43 @@ const actionButtonText = computed(() => { return setupMode.value === SetupMode.advanced ? "Configure Tools" : "Install"; }); -function setEspIdfErrorStatus() { - store.espIdfErrorStatus = ""; -} +const isVersionLowerThan5 = computed(() => { + const version = selectedEspIdfVersion.value.version; + if (version) { + const match = version.match(/v(\d+(\.\d+)?(\.\d+)?)/); + if (match) { + const versionNumber = parseFloat(match[1]); + return versionNumber < 5; + } + } + return false; +}); + +const whiteSpaceNotSupportedIdf = computed(() => { + if(isVersionLowerThan5.value) { + if (selectedEspIdfVersion.value.filename === 'manual') { + return espIdf.value.includes(' '); + } + if (selectedEspIdfVersion.value.filename !== 'manual') { + return espIdfContainer.value.includes(' '); + } + } +}) + +const whiteSpaceNotSupportedTools = computed(() => { + if(isVersionLowerThan5.value) { + return toolsFolder.value.includes(' '); + } +}) + +const buttonTooltip = computed(() => { + if (whiteSpaceNotSupportedIdf.value) { + return errMsgIdf; + } else if (whiteSpaceNotSupportedTools.value) { + return errMsgTools; + } + return ""; // No tooltip when the button is not disabled +}); function setPyExecErrorStatus() { store.pyExecErrorStatus = ""; @@ -53,12 +92,9 @@ function setToolsFolder(newToolsPath: string) {
-

{{ espIdfErrorStatus }}

-
- -
+ {{errMsgIdf}}
+
+ {{errMsgTools}} +
+
{{ actionButtonText }} @@ -103,7 +148,7 @@ function setToolsFolder(newToolsPath: string) { .error-message { padding: 0.5em; margin: 0.5em; - display: flex; + display: inline-block; justify-content: space-between; align-items: center; } From 8e405a67da88fe10686c32d2af7cf098ecf6b434 Mon Sep 17 00:00:00 2001 From: Radu Date: Tue, 19 Mar 2024 12:46:54 +0200 Subject: [PATCH 09/18] Update documentation :art: Fix formatting --- README.md | 3 ++- docs/SETUP.md | 4 +--- docs/tutorial/install.md | 4 +--- src/views/setup/ExistingSetup.vue | 16 ++++++++-------- src/views/setup/Install.vue | 30 ++++++++++++++++-------------- 5 files changed, 28 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 5f163fd40..23630d131 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,8 @@ Install ESP-IDF and ESP-IDF Tools by following the [install tutorial](./docs/tut > **NOTE:** Please take a look at [Working with multiple projects](./docs/MULTI_PROJECTS.md) for more information. Default is User settings. -- On the first time using the extension, press F1 to show the Visual Studio Code Command Palette and type **ESP-IDF: Configure ESP-IDF Extension** to open the extension configuration wizard. This will install ESP-IDF, ESP-IDF tools, create a virtual python environment with ESP-IDF and this extension python packages and configure the extension settings with these values. **NOTE: Make sure that there is no spaces in any configured path since [ESP-IDF build system doesn't support spaces yet.](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html#start-a-project)**. +- On the first time using the extension, press F1 to show the Visual Studio Code Command Palette and type **ESP-IDF: Configure ESP-IDF extension** to open the extension configuration wizard. This will install ESP-IDF, ESP-IDF tools, create a virtual python environment with ESP-IDF and this extension python packages and configure the extension settings with these values. + > **NOTE:** For versions of ESP-IDF < 5.0, spaces are not supported inside configured paths. > **NOTE:** Please take a look at [Install tutorial](./docs/tutorial/install.md) documentation or the [Setup documentation](./docs/SETUP.md) for details about extension setup and configuration. diff --git a/docs/SETUP.md b/docs/SETUP.md index d83cb14d8..237a56def 100644 --- a/docs/SETUP.md +++ b/docs/SETUP.md @@ -55,7 +55,7 @@ so make sure that if using an existing python virtual environment that installin > **NOTE:** Currently the python package `pygdbmi` used by the debug adapter still depends on some Python 2.7 libraries (libpython2.7.so.1.0) so make sure that the Python executable in `idf.pythonBinPath` you use contains these libraries. This will be dropped in later versions of ESP-IDF. -> **NOTE:** Make sure that `IDF_PATH` and `IDF_TOOLS_PATH` doesn't have any spaces to avoid any build issues since [ESP-IDF Build System does NOT support spaces yet.](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html#start-a-project). +> **NOTE**: If you want to use an ESP-IDF version < 5.0, make sure that IDF_PATH and IDF_TOOLS_PATH don't have any spaces since they were no suported in previous versions. After choosing any of the previous options, a status page is displayed showing ESP-IDF, tools and python environment setup progress status. When the setup is finished, a message is shown that "All settings have been configured. You can close this window." @@ -114,8 +114,6 @@ where: **DO NOT USE ~, $HOME OR %USERPROFILE% ENVIRONMENT VARIABLES ARE NOT RESOLVED IN THIS CONFIGURATION SETTINGS. You must use ${env:HOME} instead of \$HOME (Linux/MacOS) or %HOME% (Windows).** -> **NOTE:** Make sure that your configurations settings doesn't have any spaces to avoid any build issues. - Make sure to install the extension and extension debug adapter Python requirements by running the following commands in your terminal: ``` diff --git a/docs/tutorial/install.md b/docs/tutorial/install.md index a39619b30..177980d2c 100644 --- a/docs/tutorial/install.md +++ b/docs/tutorial/install.md @@ -27,8 +27,6 @@ - Choose the location for ESP-IDF Tools and python virtual environment (also known as `IDF_TOOLS_PATH`) which is `$HOME\.espressif` on MacOS/Linux and `%USERPROFILE%\.espressif` on Windows by default. > **NOTE:** Windows users don't need to select a python executable since it is part of the setup. -> **NOTE:** Make sure that `IDF_PATH` and `IDF_TOOLS_PATH` doesn't have any spaces to avoid any build issues. -

Select ESP-IDF

@@ -60,7 +58,7 @@ Install complete

-> **NOTE**: The advance mode allows the user to choose to use existing ESP-IDF tools by manually entering each ESP-IDF tool absolute path. Make sure each ESP-IDF tool path doesn't have any spaces. +> **NOTE**: > The advance mode allows the user to choose to use existing ESP-IDF tools by manually entering each ESP-IDF tool absolute path. Again, if chose an ESP-IDF version < 5.0, make sure each ESP-IDF tool path doesn't have any spaces, since they were no suported in previous versions.. 15. Now that the extension setup is finally done, check the [Basic use](./basic_use.md) to learn how to use the SDK Configuration editor, build, flash and monitor your Espressif device. diff --git a/src/views/setup/ExistingSetup.vue b/src/views/setup/ExistingSetup.vue index a2d0074c1..aceb13f09 100644 --- a/src/views/setup/ExistingSetup.vue +++ b/src/views/setup/ExistingSetup.vue @@ -11,11 +11,11 @@ const setupMode = computed(() => { }); const isVersionLowerThan5 = (version: string): boolean => { - if (!version) return false; - const versionParts = version.split("."); - const majorVersion = Number(versionParts[0]); - return majorVersion < 5; - } + if (!version) return false; + const versionParts = version.split("."); + const majorVersion = Number(versionParts[0]); + return majorVersion < 5; +}; function goTo(route: string, setupMode: SetupMode) { router.push(route); @@ -61,7 +61,8 @@ function goTo(route: string, setupMode: SetupMode) {

IDF Tools path: {{ prevSetup.toolsPath }}

Git path: {{ prevSetup.gitPath }}

- Whitespaces in project, ESP-IDF and ESP Tools paths are not supported in versions lower than 5.0 + Whitespaces in project, ESP-IDF and ESP Tools paths are not supported + in versions lower than 5.0

@@ -73,6 +74,5 @@ function goTo(route: string, setupMode: SetupMode) { .warning-text { color: var(--vscode-editorWarning-foreground); font-size: small; - } - \ No newline at end of file + diff --git a/src/views/setup/Install.vue b/src/views/setup/Install.vue index 3498f5dfe..58cd581a3 100644 --- a/src/views/setup/Install.vue +++ b/src/views/setup/Install.vue @@ -18,11 +18,13 @@ const { setupMode, selectedEspIdfVersion, espIdf, - espIdfContainer + espIdfContainer, } = storeToRefs(store); -const errMsgIdf = "The ESP IDF folder path cannot contain spaces for ESP-IDF version lower than 5.0"; -const errMsgTools = "The ESP Tools folder path cannot contain spaces for ESP-IDF version lower than 5.0"; +const errMsgIdf = + "The ESP IDF folder path cannot contain spaces for ESP-IDF version lower than 5.0"; +const errMsgTools = + "The ESP Tools folder path cannot contain spaces for ESP-IDF version lower than 5.0"; const isNotWinPlatform = computed(() => { return pathSep.value.indexOf("/") !== -1; @@ -45,21 +47,21 @@ const isVersionLowerThan5 = computed(() => { }); const whiteSpaceNotSupportedIdf = computed(() => { - if(isVersionLowerThan5.value) { - if (selectedEspIdfVersion.value.filename === 'manual') { - return espIdf.value.includes(' '); + if (isVersionLowerThan5.value) { + if (selectedEspIdfVersion.value.filename === "manual") { + return espIdf.value.includes(" "); } - if (selectedEspIdfVersion.value.filename !== 'manual') { - return espIdfContainer.value.includes(' '); + if (selectedEspIdfVersion.value.filename !== "manual") { + return espIdfContainer.value.includes(" "); } } -}) +}); const whiteSpaceNotSupportedTools = computed(() => { - if(isVersionLowerThan5.value) { - return toolsFolder.value.includes(' '); + if (isVersionLowerThan5.value) { + return toolsFolder.value.includes(" "); } -}) +}); const buttonTooltip = computed(() => { if (whiteSpaceNotSupportedIdf.value) { @@ -94,7 +96,7 @@ function setToolsFolder(newToolsPath: string) { class="notification is-danger error-message" v-if="whiteSpaceNotSupportedIdf" > - {{errMsgIdf}} + {{ errMsgIdf }} - {{errMsgTools}} + {{ errMsgTools }} From 3aa4596b84c21ffd222bac94da44544737c8cd8b Mon Sep 17 00:00:00 2001 From: Radu Date: Wed, 20 Mar 2024 15:13:06 +0200 Subject: [PATCH 10/18] Reverting all UI changes Use CMake Bin Path for building --- src/build/buildTask.ts | 3 +- src/views/setup/App.vue | 8 +-- src/views/setup/ExistingSetup.vue | 20 +------ src/views/setup/Install.vue | 67 ++++------------------- src/views/setup/components/folderOpen.vue | 2 +- 5 files changed, 15 insertions(+), 85 deletions(-) diff --git a/src/build/buildTask.ts b/src/build/buildTask.ts index f99d00708..031e744ee 100644 --- a/src/build/buildTask.ts +++ b/src/build/buildTask.ts @@ -163,8 +163,7 @@ export class BuildTask { compilerArgs.push("-DCCACHE_ENABLE=1"); } } - const cmakeCommand = "cmake"; - const compileExecution = new vscode.ProcessExecution(cmakeCommand, compilerArgs, this.processOptions); + const compileExecution = new vscode.ProcessExecution(canAccessCMake, compilerArgs, this.processOptions); const compilePresentationOptions = { reveal: showTaskOutput, showReuseMessage: false, diff --git a/src/views/setup/App.vue b/src/views/setup/App.vue index 209997cfd..9645e602c 100644 --- a/src/views/setup/App.vue +++ b/src/views/setup/App.vue @@ -21,7 +21,7 @@ const isLinuxPlatform = computed(() => { const openOCDRulesPathText = computed(() => { return openOCDRulesPath.value !== "" - ? `sudo cp -n "${openOCDRulesPath.value}" /etc/udev/rules.d` + ? `sudo cp -n ${openOCDRulesPath.value} /etc/udev/rules.d` : ""; }); @@ -66,7 +66,7 @@ const openOCDRulesPathText = computed(() => {

Run this command in a terminal with sudo privileges:

-
+
{{ openOCDRulesPathText }}
@@ -118,8 +118,4 @@ const openOCDRulesPathText = computed(() => { .span-path { color: var(--vscode-button-hoverBackground); } - -.keep-spaces { - white-space: pre-wrap; -} diff --git a/src/views/setup/ExistingSetup.vue b/src/views/setup/ExistingSetup.vue index aceb13f09..7ea720187 100644 --- a/src/views/setup/ExistingSetup.vue +++ b/src/views/setup/ExistingSetup.vue @@ -10,13 +10,6 @@ const setupMode = computed(() => { return SetupMode; }); -const isVersionLowerThan5 = (version: string): boolean => { - if (!version) return false; - const versionParts = version.split("."); - const majorVersion = Number(versionParts[0]); - return majorVersion < 5; -}; - function goTo(route: string, setupMode: SetupMode) { router.push(route); store.setupMode = setupMode; @@ -60,19 +53,8 @@ function goTo(route: string, setupMode: SetupMode) {

Python path: {{ prevSetup.python }}

IDF Tools path: {{ prevSetup.toolsPath }}

Git path: {{ prevSetup.gitPath }}

-

- Whitespaces in project, ESP-IDF and ESP Tools paths are not supported - in versions lower than 5.0 -

-./types - - +./types \ No newline at end of file diff --git a/src/views/setup/Install.vue b/src/views/setup/Install.vue index 58cd581a3..ffc796edf 100644 --- a/src/views/setup/Install.vue +++ b/src/views/setup/Install.vue @@ -11,21 +11,14 @@ import { IconClose } from "@iconify-prerendered/vue-codicon"; const store = useSetupStore(); const { + espIdfErrorStatus, gitVersion, pathSep, pyExecErrorStatus, toolsFolder, setupMode, - selectedEspIdfVersion, - espIdf, - espIdfContainer, } = storeToRefs(store); -const errMsgIdf = - "The ESP IDF folder path cannot contain spaces for ESP-IDF version lower than 5.0"; -const errMsgTools = - "The ESP Tools folder path cannot contain spaces for ESP-IDF version lower than 5.0"; - const isNotWinPlatform = computed(() => { return pathSep.value.indexOf("/") !== -1; }); @@ -34,43 +27,9 @@ const actionButtonText = computed(() => { return setupMode.value === SetupMode.advanced ? "Configure Tools" : "Install"; }); -const isVersionLowerThan5 = computed(() => { - const version = selectedEspIdfVersion.value.version; - if (version) { - const match = version.match(/v(\d+(\.\d+)?(\.\d+)?)/); - if (match) { - const versionNumber = parseFloat(match[1]); - return versionNumber < 5; - } - } - return false; -}); - -const whiteSpaceNotSupportedIdf = computed(() => { - if (isVersionLowerThan5.value) { - if (selectedEspIdfVersion.value.filename === "manual") { - return espIdf.value.includes(" "); - } - if (selectedEspIdfVersion.value.filename !== "manual") { - return espIdfContainer.value.includes(" "); - } - } -}); - -const whiteSpaceNotSupportedTools = computed(() => { - if (isVersionLowerThan5.value) { - return toolsFolder.value.includes(" "); - } -}); - -const buttonTooltip = computed(() => { - if (whiteSpaceNotSupportedIdf.value) { - return errMsgIdf; - } else if (whiteSpaceNotSupportedTools.value) { - return errMsgTools; - } - return ""; // No tooltip when the button is not disabled -}); +function setEspIdfErrorStatus() { + store.espIdfErrorStatus = ""; +} function setPyExecErrorStatus() { store.pyExecErrorStatus = ""; @@ -94,9 +53,12 @@ function setToolsFolder(newToolsPath: string) {
- {{ errMsgIdf }} +

{{ espIdfErrorStatus }}

+
+ +
-
- {{ errMsgTools }} -
-
{{ actionButtonText }} @@ -150,7 +103,7 @@ function setToolsFolder(newToolsPath: string) { .error-message { padding: 0.5em; margin: 0.5em; - display: inline-block; + display: flex; justify-content: space-between; align-items: center; } diff --git a/src/views/setup/components/folderOpen.vue b/src/views/setup/components/folderOpen.vue index 9dd0572b9..43bfd233f 100644 --- a/src/views/setup/components/folderOpen.vue +++ b/src/views/setup/components/folderOpen.vue @@ -34,7 +34,7 @@ function onKeyEnter() {