Skip to content

Commit

Permalink
fix: install the same version of template as package
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonrybczak committed Aug 29, 2024
1 parent 609aaa4 commit 26ec2e1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/cli/src/commands/addPlatform/addPlatform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,21 +183,23 @@ async function addPlatform(
);
}

loader.start(`Installing template packages from ${templateName}@0${version}`);
loader.start(
`Installing template packages from ${templateName}@0${matchingVersion}`,
);

const templateSourceDir = mkdtempSync(join(tmpdir(), 'rncli-init-template-'));

try {
await installTemplatePackage(
`${templateName}@0${version}`,
`${templateName}@0${matchingVersion}`,
templateSourceDir,
pm,
);
loader.succeed();
} catch (error) {
loader.fail();
throw new CLIError(
`Failed to install template packages from ${templateName}@0${version}`,
`Failed to install template packages from ${templateName}@0${matchingVersion}`,
(error as Error).message,
);
}
Expand Down

0 comments on commit 26ec2e1

Please sign in to comment.