Skip to content

Commit 4f6ec24

Browse files
author
alexlee-dev
committed
✏️ Add wrapper around rimraf removal on cleanup
1 parent e6e97a6 commit 4f6ec24

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
- Warning about unusable Node version (less than v10.0.0)
13+
- Wrapper to check if directory exists before removing with `rimraf`
1314

1415
### Changed
1516

src/util.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ export const cleanupError = async (
4949
// * Application Directory
5050
const root = path.resolve(applicationName);
5151

52-
await executeCommand("rimraf", [root]);
52+
const rootExists = await fs.pathExists(root);
53+
54+
if (rootExists) {
55+
await executeCommand("rimraf", [root]);
56+
}
5357
} catch (error) {
5458
throw new Error(error);
5559
}

0 commit comments

Comments
 (0)