File tree 2 files changed +22
-1
lines changed
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change
1
+ import fs from 'node:fs' ;
2
+
3
+ function rm ( path : string , options : {
4
+ recursive : boolean ;
5
+ force : boolean ;
6
+ } ) {
7
+ fs . rmSync ( path , {
8
+ recursive : options . recursive ,
9
+ force : options . force ,
10
+ } ) ;
11
+ }
12
+
13
+ export default rm ;
Original file line number Diff line number Diff line change 2
2
import { Command } from 'commander' ;
3
3
import { version } from '../package.json' ;
4
4
import cp from './commands/cp' ;
5
+ import rm from './commands/rm' ;
5
6
import server from './commands/server' ;
6
7
7
8
const program = new Command ( )
8
- . name ( 'fsx ' )
9
+ . name ( 'du ' )
9
10
. description ( 'A collection of cross-platform compatible functions and shell commands that aid in npm package development.' )
10
11
. version ( version ) ;
11
12
@@ -18,6 +19,13 @@ program.command('cp')
18
19
. option ( '-i, --ignore <string>' , 'Ignore file(s) or directory' )
19
20
. action ( cp ) ;
20
21
22
+ program . command ( 'rm' )
23
+ . description ( 'Remove files and directories.' )
24
+ . argument ( '<string>' , 'File or directory to remove' )
25
+ . option ( '-r, --recursive' , 'Remove directories recursively' , false )
26
+ . option ( '-f, --force' , 'Ignore nonexistent files and arguments' , false )
27
+ . action ( rm ) ;
28
+
21
29
program . command ( 'server' )
22
30
. description ( 'Host a static local server using the specified directory as root.' )
23
31
. argument ( '<string>' , 'Root directory' )
You can’t perform that action at this time.
0 commit comments