Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
only warn instead of delete option
Browse files Browse the repository at this point in the history
if folder not empty
  • Loading branch information
neminovno committed May 20, 2019
1 parent cba8196 commit 2a05b65
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Install it from VSCode or click Install on [Marketplace](https://marketplace.vis
### New Project command

- creates project files in selected folder
- will ask to delete all files if selected folder is not empty
- reads AIR version from SDK's airsdk.xml, if not available uses 30.0

Run it with right click in Explorer menu:
Expand Down
10 changes: 9 additions & 1 deletion src/project-builder/NewProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class NewProjectCommand {


//
if (!isDirEmpty(targetDir)) {
/* if (!isDirEmpty(targetDir)) {
const toDeleteFiles_confirm = await window.showWarningMessage("Before creating new project, all files will be deleted in:\n" + targetDir + "\n\nContinue?", { modal: true }, "No", "Yes");
if (toDeleteFiles_confirm !== 'Yes') {
Expand All @@ -46,6 +46,14 @@ export default class NewProjectCommand {
log('deleting all files in target dir');
await deleteFiles(targetDir);
} */

if (!isDirEmpty(targetDir)) {
const toContinue = await window.showWarningMessage("Selected folder is not empty. Some files may be overwritten. Continue?", { modal: true }, "Yes");

if (toContinue !== 'Yes') {
return;
}
}

// STEP 1
Expand Down

0 comments on commit 2a05b65

Please sign in to comment.