Skip to content

Commit

Permalink
run -f as default
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Feb 1, 2019
1 parent 61dcf6c commit 9f2e1ab
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ async function runCmd (argv, stdout, stderr) {
args = require("arg")({
"--external": [String],
"-e": "--external",
"--force": Boolean,
"-f": "--force",
"--out": String,
"-o": "--out",
"--minify": Boolean,
Expand Down Expand Up @@ -180,17 +178,8 @@ async function runCmd (argv, stdout, stderr) {
require("os").tmpdir(),
crypto.createHash('md5').digest(resolve(args._[1] || ".")).toString('hex')
);
if (fs.existsSync(outDir)) {
if (args["--force"]) {
rimraf.sync(outDir);
}
else {
nccError(
`Error: Application at ${args._[1] || "."} is already running or didn't cleanup after previous run.\n` +
`To force clear the last run build, try running the "ncc run -f" flag.`
);
}
}
if (fs.existsSync(outDir))
rimraf.sync(outDir);
run = true;

// fallthrough
Expand Down

0 comments on commit 9f2e1ab

Please # to comment.