Skip to content

Commit

Permalink
Merge branch 'fix/bootstrap_fixes' into fix/lightningjs_port
Browse files Browse the repository at this point in the history
* fix/bootstrap_fixes:
  fix non-local template triggering wrong error
  • Loading branch information
pavjacko committed Apr 9, 2024
2 parents 8cf25d2 + 6a67153 commit 46e83ea
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const Question = async (data: NewProjectData) => {
}
}

const nmDir = path.join(c.paths.project.dir, RnvFolderName.dotRnv, RnvFolderName.npmCache);
const npmCacheDir = path.join(c.paths.project.dir, RnvFolderName.dotRnv, RnvFolderName.npmCache);

if (localTemplatePath) {
if (!fsExistsSync(localTemplatePath)) {
Expand All @@ -112,7 +112,7 @@ const Question = async (data: NewProjectData) => {
}
const pkg = readObjectSync<NpmPackageFile>(localTemplatePkgPath);

mkdirSync(nmDir);
mkdirSync(npmCacheDir);
if (!pkg?.name) {
return Promise.reject(`Invalid package ${localTemplatePkgPath} missing name field`);
}
Expand All @@ -123,7 +123,7 @@ const Question = async (data: NewProjectData) => {

if (!inputs.template) return;

const nmTemplatePath = path.join(nmDir, pkg?.name);
const nmTemplatePath = path.join(npmCacheDir, pkg?.name);

logInfo(`Found local template: ${pkg.name}@${pkg.version}`);

Expand Down Expand Up @@ -189,6 +189,7 @@ const Question = async (data: NewProjectData) => {
}
);
// Check if node_modules folder exists
const nmDir = path.join(c.paths.project.dir, 'node_modules');
if (!fsExistsSync(nmDir)) {
return Promise.reject(
`${isYarnInstalled() ? 'yarn' : 'npm'} add ${inputs.template.packageName}@${
Expand Down

0 comments on commit 46e83ea

Please sign in to comment.