Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dist deploy script #1492

Merged
merged 1 commit into from
Sep 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions swagger-editor-dist-package/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down