Skip to content

Commit

Permalink
use 7.0 for gen2
Browse files Browse the repository at this point in the history
.

.

.
  • Loading branch information
denysoblohin-okta committed Oct 30, 2023
1 parent 5d0ada4 commit 2d415f4
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,32 @@ if [ ! -z "$AUTHJS_VERSION" ]; then

yarn global add @okta/siw-platform-scripts@0.7.0

rm -rf ./node_modules/@okta/okta-auth-js
mv -f ./node_modules/@okta/okta-auth-js ./okta-auth-js-orig
rm -rf ./src/v3/node_modules/@okta/okta-auth-js

authjs_semver_g2=$(cat ./package.json | jq '.dependencies["@okta/okta-auth-js"]')
json=$(cat ./package.json | jq 'del(.dependencies["@okta/okta-auth-js"])')
printf '%s\n' "${json}" > ./package.json
json=$(cat ./src/v3/package.json | jq 'del(.dependencies["@okta/okta-auth-js"])')
printf '%s\n' "${json}" > ./src/v3/package.json

if ! siw-platform install-artifact -n @okta/okta-auth-js -v ${AUTHJS_VERSION} ; then
echo "AUTHJS_VERSION could not be installed: ${AUTHJS_VERSION}"
exit ${FAILED_SETUP}
fi

json_v3=$(cat ./src/v3/package.json | jq --arg ver $AUTHJS_VERSION '.dependencies["@okta/okta-auth-js"] = $ver')
printf '%s\n' "${json_v3}" > ./src/v3/package.json
cp -r ./node_modules/@okta/okta-auth-js ./src/v3/node_modules/@okta
json=$(cat ./src/v3/package.json | jq --arg ver $AUTHJS_VERSION '.dependencies["@okta/okta-auth-js"] = $ver')
printf '%s\n' "${json}" > ./src/v3/package.json
json=$(cat ./package.json | jq --arg ver $authjs_semver_g2 '.dependencies["@okta/okta-auth-js"] = $ver')
printf '%s\n' "${json}" > ./package.json

mv -f ./node_modules/@okta/okta-auth-js ./src/v3/node_modules/@okta/okta-auth-js
mv -f ./okta-auth-js-orig ./node_modules/@okta/okta-auth-js

authjs_ver_g2=$(cat ./node_modules/@okta/okta-auth-js/package.json | jq '.version')
authjs_ver_g3=$(cat ./src/v3/node_modules/@okta/okta-auth-js/package.json | jq '.version')
echo "okta-auth-js versions used: ${authjs_ver_g2} for gen 2, ${authjs_ver_g3} for gen 3"


# Remove any changes to package.json
git checkout .
Expand Down

0 comments on commit 2d415f4

Please sign in to comment.