mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-21 05:02:39 +08:00
14 lines
374 B
TypeScript
14 lines
374 B
TypeScript
import type { ExecOptions } from 'shelljs';
|
|
import shell from 'shelljs';
|
|
|
|
export const exec = async (command: string, options: ExecOptions = {}) =>
|
|
new Promise((resolve, reject) => {
|
|
shell.exec(command, options, (code) => {
|
|
if (code === 0) {
|
|
resolve();
|
|
} else {
|
|
reject(new Error(`command exited with code: ${code}`));
|
|
}
|
|
});
|
|
});
|