feat: 脚手架基本ok
This commit is contained in:
13
bin/utils/shell.ts
Normal file
13
bin/utils/shell.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import shelljs from 'shelljs';
|
||||
|
||||
export function shellExec(command: string) {
|
||||
return new Promise<number>((resolve, reject) => {
|
||||
shelljs.exec(command, { async: true, silent: false}, (code) => {
|
||||
if (code === 0) {
|
||||
resolve(0);
|
||||
} else {
|
||||
reject(new Error(`${code}`));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user