Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
kmalinich committed Sep 25, 2024
1 parent f4a0790 commit 78706d0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bin/preinstall
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ FILE_TMP="$(mktemp)"
jq .dependencies package.json | awk -F '"' '/"/ {print $2 "@" $4}' > "${FILE_TMP}"
jq .devDependencies package.json | awk -F '"' '/"/ {print $2 "@" $4}' >> "${FILE_TMP}"

ARRAY_INSTALL=()

# Install version-specific npm packages globally
for DEP in "${ARRAY_LINK[@]}"; do
Expand All @@ -39,13 +40,14 @@ for DEP in "${ARRAY_LINK[@]}"; do
exit 1
fi

[[ "${1}" == "--no-install" ]] && continue
ARRAY_INSTALL+=("${DEP_FULL}")
done

echo "npm -g i '${DEP_FULL}'"
npm -g i "${DEP_FULL}" --unsafe-perm
if [[ "${1}" != "--no-install" ]]; then
echo "npm -g i '${ARRAY_INSTALL[*]}'"
npm -g i "${ARRAY_INSTALL[@]}" --unsafe-perm
echo
done
echo
fi

# Link npm packages from global to local
echo "npm link '${ARRAY_LINK[*]}'"
Expand Down

0 comments on commit 78706d0

Please sign in to comment.