From b10b6c19f912d83ff53d870ddbd719a4b1b9eaa2 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Tue, 3 Jan 2023 21:14:35 -0700 Subject: [PATCH] Use variable for local package scope --- .../cerc-builder-js/build-npm-package-local-dependencies.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh b/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh index 51b5ede8..84327528 100755 --- a/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh +++ b/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh @@ -16,10 +16,10 @@ package_publish_version=$2 # TODO: make this a paramater and allow a list of scopes npm_scope_for_local="@cerc-io" # We need to configure the local registry -npm config set @cerc-io:registry ${local_npm_registry_url} +npm config set ${npm_scope_for_local}:registry ${local_npm_registry_url} npm config set -- ${local_npm_registry_url}:_authToken ${NPM_AUTH_TOKEN} # Find the set of dependencies from the specified scope -mapfile -t dependencies_from_scope < <(cat package.json | jq -r '.dependencies | with_entries(if (.key|test("^@cerc-io/.*$")) then ( {key: .key, value: .value } ) else empty end ) | keys[]') +mapfile -t dependencies_from_scope < <(cat package.json | jq -r '.dependencies | with_entries(if (.key|test("^'${npm_scope_for_local}'/.*$")) then ( {key: .key, value: .value } ) else empty end ) | keys[]') echo "Fixing up dependencies" for package in "${dependencies_from_scope[@]}" do