Skip to content

Commit

Permalink
Merge pull request #296 from zowe/ci/fix-rewrite-shrinkwrap
Browse files Browse the repository at this point in the history
Fix CLI package pointing to Zowe Artifactory
  • Loading branch information
t1m0thyj authored Nov 21, 2024
2 parents 7ad3395 + 63f2242 commit 83f5101
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion scripts/repackage_tar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# Copyright Contributors to the Zowe Project.
#
###
set -e

die () {
echo "$@"
Expand Down Expand Up @@ -46,7 +47,7 @@ npmDeps=`node -e "package = require('./package.json');
Object.entries(package.peerDependencies || {}).forEach(([name, version]) => console.log(name + '@' + version));"`
for pkgSpec in $npmDeps; do
echo "Validating dependency $pkgSpec..."
npm view $pkgSpec || exit 1
npm view $pkgSpec || die "Validation of $pkgSpec failed"
done

# Update npm-shrinkwrap.json if necessary
Expand All @@ -56,6 +57,7 @@ if [ -e "npm-shrinkwrap.json" ]; then

# Rewrite the shrinkwrap file with only production dependencies and public npm resolved URLs
node "../../scripts/rewrite-shrinkwrap.js"
(! grep -q zowe.jfrog.io npm-shrinkwrap.json) || die "Private registry found in shrinkwrap file"
fi

npm pack
Expand Down
2 changes: 1 addition & 1 deletion scripts/rewrite-shrinkwrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const data = require(_path);
(async () => {
const filterPkgs = async (obj, key) => {
const _obj = {};
for (const pkg of Object.keys(obj[key])) {
for (const pkg of Object.keys(obj[key] || {})) {
if (obj[key][pkg].dev) continue;
if (obj[key][pkg].peer) continue;
if (obj[key][pkg].extraneous) continue;
Expand Down

0 comments on commit 83f5101

Please sign in to comment.