Skip to content

Commit

Permalink
fix(remix-dev/cli/init): only run npm install when package.json i…
Browse files Browse the repository at this point in the history
…s available (#3146)
  • Loading branch information
MichaelDeBoey committed May 9, 2022
1 parent 527f592 commit 21c1187
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/remix-dev/cli/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,18 @@ export async function init(
) {
let initScriptDir = path.join(projectDir, "remix.init");
let initScript = path.resolve(initScriptDir, "index.js");
let initPackageJson = path.resolve(initScriptDir, "package.json");

let isTypeScript = fse.existsSync(path.join(projectDir, "tsconfig.json"));

if (await fse.pathExists(initScript)) {
execSync(`${packageManager} install`, {
stdio: "ignore",
cwd: initScriptDir,
});
if (await fse.pathExists(initPackageJson)) {
execSync(`${packageManager} install`, {
stdio: "ignore",
cwd: initScriptDir,
});
}

let initFn = require(initScript);
try {
await initFn({ rootDirectory: projectDir, isTypeScript });
Expand Down

0 comments on commit 21c1187

Please sign in to comment.