Skip to content

Commit

Permalink
safeguard
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 committed Dec 1, 2022
1 parent 0995cff commit c289e3d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 8 additions & 3 deletions dist/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -89792,9 +89792,14 @@ function listNPMTags(packageName) {
packageName = JSON.parse(require$$0$1.readFileSync('package.json')).name;
}
coreExports.info(`Fetching npm versions for ${packageName}`);
return JSON.parse(
cp__default["default"].execSync(`npm view ${packageName} versions --json`).toString(),
).reverse();
// safeguard in case there is 1 version (the cmd returns a string)
return []
.concat(
JSON.parse(
cp__default["default"].execSync(`npm view ${packageName} versions --json`).toString(),
),
)
.reverse();
}
async function listGithubReleases(repoName) {
let owner, repo;
Expand Down
11 changes: 8 additions & 3 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ function listNPMTags(packageName) {
packageName = JSON.parse(readFileSync('package.json')).name;
}
info(`Fetching npm versions for ${packageName}`);
return JSON.parse(
cp.execSync(`npm view ${packageName} versions --json`).toString(),
).reverse();
// safeguard in case there is 1 version (the cmd returns a string)
return []
.concat(
JSON.parse(
cp.execSync(`npm view ${packageName} versions --json`).toString(),
),
)
.reverse();
}
async function listGithubReleases(repoName) {
let owner, repo;
Expand Down

0 comments on commit c289e3d

Please sign in to comment.