diff --git a/packages/migrate/src/index.js b/packages/migrate/src/index.js index 3cf2524b..a4bac0d2 100644 --- a/packages/migrate/src/index.js +++ b/packages/migrate/src/index.js @@ -54,40 +54,37 @@ export default async function(options) { fileNames: {} }; - await Promise.all( - files.map(async file => { - const basename = path.basename(file); - if (basename.endsWith(".marko")) { - const prettyPrintOptions = { - syntax: options.syntax, - maxLen: options.maxLen, - noSemi: options.noSemi, - singleQuote: options.singleQuote, - filename: file - }; - const migrateHelper = new MigrateHelper(options.prompt); - const add = migrateOptions => - addMigration(migrateHelper, migrateOptions); - const source = await fs.readFile(file, "utf-8"); - const ast = markoCompiler.parse(source, file, { - onContext(ctx) { - prettyPrintOptions.context = ctx; - ctx.addMigration = add; - addDefaultMigrations(ctx, results); - }, - migrate: true, - raw: true - }); - - await runAutoMigrations(migrateHelper); - - results.fileContents[file] = markoPrettyprint.prettyPrintAST( - ast, - prettyPrintOptions - ); - } - }) - ); + for (const file of files) { + const basename = path.basename(file); + if (basename.endsWith(".marko")) { + const prettyPrintOptions = { + syntax: options.syntax, + maxLen: options.maxLen, + noSemi: options.noSemi, + singleQuote: options.singleQuote, + filename: file + }; + const migrateHelper = new MigrateHelper(options.prompt); + const add = migrateOptions => addMigration(migrateHelper, migrateOptions); + const source = await fs.readFile(file, "utf-8"); + const ast = markoCompiler.parse(source, file, { + onContext(ctx) { + prettyPrintOptions.context = ctx; + ctx.addMigration = add; + addDefaultMigrations(ctx, results); + }, + migrate: true, + raw: true + }); + + await runAutoMigrations(migrateHelper); + + results.fileContents[file] = markoPrettyprint.prettyPrintAST( + ast, + prettyPrintOptions + ); + } + } return results; }