mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-05 19:41:42 +08:00
fix(cli): incorrect ensureDir usage (#5933)
This commit is contained in:
parent
928b5875de
commit
cd07773e34
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import inquirer from 'inquirer';
|
||||
import consola from 'consola';
|
||||
import { ensureDir } from 'fs-extra';
|
||||
import { VanGenerator } from './generator';
|
||||
|
||||
@ -15,10 +16,14 @@ const PROMPTS = [
|
||||
export default async function run() {
|
||||
const { name } = await inquirer.prompt(PROMPTS);
|
||||
|
||||
ensureDir(name);
|
||||
try {
|
||||
await ensureDir(name);
|
||||
|
||||
const generator = new VanGenerator(name);
|
||||
generator.run();
|
||||
const generator = new VanGenerator(name);
|
||||
generator.run();
|
||||
} catch (e) {
|
||||
consola.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
|
Loading…
x
Reference in New Issue
Block a user