forked from cerc-io/stack-orchestrator
Merge pull request #265 from cerc-io/dboreham/fix-yarn-lock-processing
Handle semver spec in package.json local dependencies
Former-commit-id: 7f155023d2
This commit is contained in:
commit
fddd728037
@ -18,8 +18,9 @@ fi
|
|||||||
set -e
|
set -e
|
||||||
target_package=$1
|
target_package=$1
|
||||||
local_npm_registry_url=$2
|
local_npm_registry_url=$2
|
||||||
# TODO: use jq rather than sed here:
|
# Extract the actual version pinned in yarn.lock
|
||||||
versioned_target_package=$(grep ${target_package} package.json | sed -e 's#[[:space:]]\{1,\}\"\('${target_package}'\)\":[[:space:]]\{1,\}\"\(.*\)\",#\1@\2#' )
|
# See: https://stackoverflow.com/questions/60454251/how-to-know-the-version-of-currently-installed-package-from-yarn-lock
|
||||||
|
versioned_target_package=$(yarn list --pattern ${target_package} --depth=0 --json --non-interactive --no-progress | jq -r '.data.trees[].name')
|
||||||
# Use yarn info to get URL checksums etc from the new registry
|
# Use yarn info to get URL checksums etc from the new registry
|
||||||
yarn_info_output=$(yarn info --json $versioned_target_package 2>/dev/null)
|
yarn_info_output=$(yarn info --json $versioned_target_package 2>/dev/null)
|
||||||
# First check if the target version actually exists.
|
# First check if the target version actually exists.
|
||||||
|
Loading…
Reference in New Issue
Block a user