Skip to content

Commit

Permalink
refactor(cli/migrate): check git status as soon as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori committed Apr 6, 2022
1 parent 254dfa4 commit 25560fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions packages/remix-dev/cli/migrate/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ export const run = async (input: {
flags: Flags;
}) => {
let projectDir = checkProjectDir(input.projectDir);
if (!input.flags.dry) {
checkGitStatus(projectDir, { force: input.flags.force });
}

let migration = parseMigration(input.migrationId);
return migration.function({ projectDir, flags: input.flags });
};
4 changes: 4 additions & 0 deletions packages/remix-dev/cli/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import inquirer from "inquirer";
import * as colors from "../colors";
import * as commands from "./commands";
import { validateNewProjectPath, validateTemplate } from "./create";
import { checkGitStatus } from "./checkGitStatus";

const helpText = `
${colors.logoBlue("R")} ${colors.logoGreen("E")} ${colors.logoYellow(
Expand Down Expand Up @@ -349,6 +350,9 @@ export async function run(argv: string[] = process.argv.slice(2)) {
migrationId: flags.migration,
projectDir: input[1],
});
if (!flags.dry) {
checkGitStatus(projectDir, { force: flags.force });
}
await commands.migrate.run({ migrationId, projectDir, flags });
break;
}
Expand Down

0 comments on commit 25560fb

Please sign in to comment.