File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env node
2+ const rimraf = require ( 'rimraf' )
3+ const paths = require ( '../src/paths' )
4+ const { promisify } = require ( 'util' )
5+
6+
7+ const rm = promisify ( rimraf )
8+
9+ module . exports = async ( ) => {
10+ await rm ( paths . templates )
11+ }
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ const log = require('../src/log')
77const init = require ( './init' )
88const upgrade = require ( './upgrade' )
99const update = require ( './update' )
10+ const clean = require ( './clean' )
1011const { version } = require ( '../package.json' )
1112
1213
@@ -50,6 +51,16 @@ program
5051 . catch ( err => log . error ( 'program' , 'update break' , err ) )
5152 } )
5253
54+ program
55+ . command ( 'clean' )
56+ . description ( 'Clean the cache of mili' )
57+ . action ( ( ) => {
58+ log . info ( 'begin clean' )
59+ clean ( )
60+ . then ( ( ) => log . info ( 'clean complete' ) )
61+ . catch ( err => log . error ( 'clean' , 'clean break' , err ) )
62+ } )
63+
5364
5465// error on unknown commands
5566program . on ( 'command:*' , function ( ) {
Original file line number Diff line number Diff line change 4747 "cosmiconfig" : " ^5.0.6" ,
4848 "merge-deep" : " ^3.0.2" ,
4949 "mustache" : " ^3.0.0" ,
50+ "rimraf" : " ^2.6.2" ,
5051 "sanitization" : " ^0.3.0" ,
5152 "semver" : " ^5.6.0" ,
5253 "simple-git" : " ^1.104.0"
You can’t perform that action at this time.
0 commit comments