Skip to content

Commit

Permalink
Added empty project name warning for MicroPython projects
Browse files Browse the repository at this point in the history
Signed-off-by: paulober <[email protected]>
  • Loading branch information
paulober committed Sep 9, 2024
1 parent 1f7a5ff commit 8cb6e8e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/webview/newMicroPythonProjectPanel.mts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,20 @@ export class NewMicroPythonProjectPanel {
return;
}

if (
data.projectName === undefined ||
data.projectName.length === 0
) {
void window.showWarningMessage(
"The project name is empty. Please enter a project name."
);
await this._panel.webview.postMessage({
command: "submitDenied",
});

return;
}

// check if projectRoot/projectName folder already exists
if (
existsSync(join(this._projectRoot.fsPath, data.projectName))
Expand Down

0 comments on commit 8cb6e8e

Please sign in to comment.