Skip to content

Commit

Permalink
feat(cli/migrate): handle remix setup without runtime arg in `repla…
Browse files Browse the repository at this point in the history
…ce-remix-imports`
  • Loading branch information
pcattori committed Apr 6, 2022
1 parent 6c05072 commit 1829eb3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ const resolveRuntime = async ({
scripts,
}: PackageJson): Promise<Runtime> => {
// match `remix setup <runtime>` in `postinstall` script
let remixSetupMatch = scripts?.postinstall?.match(/remix setup (\w+)/);
let remixSetupMatch = scripts?.postinstall?.match(/remix setup(\s+\w+)/);
if (remixSetupMatch && remixSetupMatch.length >= 2) {
let postinstallRuntime = remixSetupMatch[1];
let postinstallRuntime = remixSetupMatch[1].trim();
if (isRuntime(postinstallRuntime)) {
return postinstallRuntime;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ function* getTasks({
}

// `remix setup` in `postinstall`
let remixSetup = packageJson.scripts?.postinstall?.match(/remix setup \w+/);
let remixSetup =
packageJson.scripts?.postinstall?.match(/remix setup(\s+\w+)?/);
if (remixSetup) {
yield `Remove \`${remixSetup}\` from your \`postinstall\` script`;
yield `Remove \`${remixSetup[0]}\` from your \`postinstall\` script`;
}
}

Expand Down

0 comments on commit 1829eb3

Please sign in to comment.