init for deploy files
This commit is contained in:
16
src/app.ts
Normal file
16
src/app.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { program , Command} from 'commander';
|
||||
import fs from 'fs';
|
||||
|
||||
// 将多个子命令加入主程序中
|
||||
program.name('app').description('A CLI tool with envison').version('0.0.1');
|
||||
|
||||
const ls =new Command('ls')
|
||||
.description('List files in the current directory')
|
||||
.action(() => {
|
||||
console.log('List files');
|
||||
console.log(fs.readdirSync(process.cwd()));
|
||||
});
|
||||
program.addCommand(ls);
|
||||
|
||||
export const app = program;
|
||||
export { program, Command };
|
||||
Reference in New Issue
Block a user