diff --git a/swagger-editor-dist-package/deploy.sh b/swagger-editor-dist-package/deploy.sh index 7f4dcf3b5af..8e4523bf8df 100755 --- a/swagger-editor-dist-package/deploy.sh +++ b/swagger-editor-dist-package/deploy.sh @@ -3,15 +3,23 @@ # Parameter Expansion: http://stackoverflow.com/questions/6393551/what-is-the-meaning-of-0-in-a-bash-script cd "${0%/*}" -# Get UI version +# Get Editor version EDITOR_VERSION=$(node -p "require('../package.json').version") -# Replace our version placeholder with UI's version -sed -i "s|\$\$VERSION|$EDITOR_VERSION|g" package.json +# Replace our version placeholder with Editor's version +sed -i.bak "s/\$\$VERSION/$EDITOR_VERSION/g" package.json +rm package.json.bak # Copy Editor's dist files to our directory cp ../dist/* . +# Copy index.html +cp ../index.html . + +# Rewire `./dist` references to `.` in index.html +sed -i.bak "s/\.\/dist/\./g" index.html +rm index.html.bak + if [ "$PUBLISH_DIST" = "true" ] || [ "$TRAVIS" = "true" ] ; then npm publish . else