Skip to content

Commit

Permalink
fix: e2e folder deleted permanently (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavsingh97 authored Aug 4, 2021
1 parent 9d279fc commit ea67a60
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/schematics/nightwatch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,12 @@ function removeFiles(): Rule {

function deleteDirectory(tree: Tree, path: string): void {
try {
tree.delete(path);
} catch (error) {
if (/does not exist/.test(error)) {
console.warn("⚠️ Skipping deletion: e2e/ directory doesn't exist");
if (tree.getDir(path).subfiles.length > 0 || tree.getDir(path).subdirs.length > 0) {
tree.rename('e2e', `protractor/${path}`);
} else {
console.warn(`⚠️ Skipping deletion: ${path} doesn't exist`);
}
}
} catch (error) {}
}

export const removeE2ELinting = (tree: Tree, angularJsonVal: any, project: string) => {
Expand Down

0 comments on commit ea67a60

Please sign in to comment.