Skip to content

Commit 3a361d4

Browse files
author
Rishabh Karnad
committed
Replaced rm -rf with rimraf.sync
1 parent bcdfe07 commit 3a361d4

File tree

3 files changed

+26
-16
lines changed

3 files changed

+26
-16
lines changed

package-lock.json

Lines changed: 22 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"lodash.union": "^4.6.0",
3939
"ora": "^3.4.0",
4040
"prompt": "^1.0.0",
41+
"rimraf": "^3.0.0",
4142
"semver-regex": "^3.1.0"
4243
}
4344
}

src/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const program = require("commander");
88
const prompt = require("prompt");
99
const ora = require("ora");
1010
const union = require("lodash.union")
11+
const remove = require("rimraf").sync;
1112

1213
const promptModule = require("./prompt/index");
1314
const constantObjects = require("./utils/constants");
@@ -156,9 +157,7 @@ function removeExistingDirectory(directoryName) {
156157
const spinner = ora(
157158
chalk.yellow(`Removing pre-existing directory with name ${directoryName}\n`),
158159
).start();
159-
const crnaProjectCreationResponse = spawnSync("rm", ["-fr", directoryName], {
160-
stdio: "inherit"
161-
});
160+
remove(directoryName)
162161
spinner.succeed(
163162
chalk.yellow(`Removed pre-existing directory with name ${directoryName}\n`),
164163
);
@@ -288,7 +287,7 @@ async function setupVueNativeApp(projectName, cmd, isCrna = false) {
288287

289288
process.chdir(projectName);
290289
spawnSync("mv", ["App.js", "App.vue"]);
291-
spawnSync("rm", ["App.test.js"]);
290+
remove("App.test.js");
292291
// If created through crna
293292
//
294293
if (isCrna) {

0 commit comments

Comments
 (0)