Skip to content

Commit e673837

Browse files
authored
Fix installed version to compute diff (#1599)
Previous update makes the code take pre-release versions into account, but forgot the `@` prefix in the `npm install` command.
1 parent 8bd46de commit e673837

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/prepare-release.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ MissingPackageError.prototype = Error.prototype;
6464
async function computeDiff(type) {
6565
const packageName = type.replace(/\d+$/, '');
6666
const majorVersionMatch = type.match(/(\d+)$/);
67-
const majorVersion = majorVersionMatch ? '@' + majorVersionMatch[1] : '';
67+
const majorVersion = majorVersionMatch ? majorVersionMatch[1] : '';
6868

6969
// Install @webref package in tmp folder
7070
// If package is pinned to a major version, we'll use that one.
@@ -88,12 +88,12 @@ async function computeDiff(type) {
8888
}
8989
}
9090
try {
91-
execSync(`npm install @webref/${packageName}${versionToInstall}`, {
91+
execSync(`npm install @webref/${packageName}@${versionToInstall}`, {
9292
cwd: tmpFolder
9393
});
9494
}
9595
catch (err) {
96-
throw new MissingPackageError(`Package @webref/${packageName}${versionToInstall} does not exist or could not be installed.`);
96+
throw new MissingPackageError(`Package @webref/${packageName}@${versionToInstall} does not exist or could not be installed.`);
9797
}
9898

9999
// Extract released version (will be used in the body of the pre-release PR)

0 commit comments

Comments
 (0)