From 04d02b55d182896522a4b87bd9e23ac8d892b031 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Wed, 31 Aug 2016 18:58:59 -0700 Subject: [PATCH] build(publish): replace version placeholders in .min.js files --- scripts/publish/publish-build-artifacts.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/scripts/publish/publish-build-artifacts.sh b/scripts/publish/publish-build-artifacts.sh index b2c70e028e..b0d4d04669 100755 --- a/scripts/publish/publish-build-artifacts.sh +++ b/scripts/publish/publish-build-artifacts.sh @@ -31,15 +31,12 @@ function publishRepo { BUILD_VER="2.0.0-${SHORT_SHA}" if [[ ${TRAVIS} ]]; then find $REPO_DIR/ -type f -name package.json -print0 | xargs -0 sed -i "s/\\\$\\\$ANGULAR_VERSION\\\$\\\$/${BUILD_VER}/g" - UMD=$(find $REPO_DIR/ -type f -name "*umd.js" -print) - if [[ ${UMD} ]]; then - for UMD_FILE in ${UMD}; do - sed -i "s/\\\$\\\$ANGULAR_VERSION\\\$\\\$/${BUILD_VER}/g" ${UMD_FILE} - done - fi - else - find $REPO_DIR/ -type f -name package.json -print0 | xargs -0 sed -i '' "s/\\\$\\\$ANGULAR_VERSION\\\$\\\$/${BUILD_VER}/g" - find $REPO_DIR/ -type f -name "*umd.js" -print0 | xargs -0 sed -i '' "s/\\\$\\\$ANGULAR_VERSION\\\$\\\$/${BUILD_VER}/g" + + # Find umd.js and umd.min.js + UMD_FILES=$(find $REPO_DIR/ -type f -name "*.umd*.js" -print) + for UMD_FILE in ${UMD_FILES}; do + sed -i "s/\\\$\\\$ANGULAR_VERSION\\\$\\\$/${BUILD_VER}/g" ${UMD_FILE} + done fi echo `date` > $REPO_DIR/BUILD_INFO echo $SHA >> $REPO_DIR/BUILD_INFO