Skip to content

Commit

Permalink
fix(assets): async for assets command
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript committed Aug 20, 2020
1 parent a2e6ea2 commit 074a080
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/preset-dumi/src/plugins/commands/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ export default (api: IApi) => {
*/
api.registerCommand({
name: 'assets',
fn({ args }) {
async fn({ args }) {
const assetsOutputPath = path.resolve(api.paths.cwd, args._[0] || 'assets.json');
const fileName = path.parse(assetsOutputPath).base;

api.logger.log(`Start to generate ${fileName}...`);

getRouteConfig(api, ctx.opts);
await getRouteConfig(api, ctx.opts);
fs.writeFileSync(assetsOutputPath, JSON.stringify(assetsPkg, null, 2));

api.logger.log(`Generate ${fileName} successfully!`);
Expand Down

0 comments on commit 074a080

Please sign in to comment.