Skip to content

Commit 479f363

Browse files
committed
fix(cli): use rimraf to replace rm -rf
1 parent 1c8cb3e commit 479f363

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/cli/generators/project/templates/package.plain.json.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"build": "tsc --outDir dist --target es2017",
1515
"build:all-dist": "npm run build",
1616
"build:watch": "tsc --outDir dist --target es2017 --watch",
17-
"clean": "rm -rf dist",
17+
"clean": "rimraf dist",
1818
<% if (project.prettier && project.tslint) { -%>
1919
"lint": "npm run prettier:check && npm run tslint",
2020
"lint:fix": "npm run tslint:fix && npm run prettier:fix",
@@ -79,6 +79,7 @@
7979
<% } -%>
8080
},
8181
"devDependencies": {
82+
"rimraf": "<%= project.dependencies['rimraf'] -%>",
8283
"@loopback/testlab": "<%= project.dependencies['@loopback/testlab'] -%>",
8384
<% if (project.mocha) { -%>
8485
"@types/mocha": "<%= project.dependencies['@types/mocha'] -%>",

packages/cli/test/integration/lib/project-generator.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,15 @@ module.exports = function(projGenerator, props, projectType) {
330330
'package.json',
331331
`"@loopback/context": "${deps['@loopback/context']}"`,
332332
);
333+
assert.fileContent('package.json', `"rimraf": "${deps['rimraf']}"`);
333334
assert.noFileContent([
334335
['package.json', '@loopback/build'],
335336
['package.json', '@loopback/dist-util'],
336337
['tslint.json', '@loopback/build'],
337338
['tsconfig.json', '@loopback/build'],
338339
]);
339340
assert.fileContent([
341+
['package.json', '"clean": "rimraf dist"'],
340342
['package.json', '"typescript"'],
341343
['package.json', '"tslint"'],
342344
['package.json', '"prettier"'],

0 commit comments

Comments
 (0)