Skip to content

Commit 96344aa

Browse files
authored
Merge pull request #1492 from shockey/bug/dist-package-html
Update dist deploy script
2 parents 16a7596 + 03435ba commit 96344aa

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

swagger-editor-dist-package/deploy.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,23 @@
33
# Parameter Expansion: http://stackoverflow.com/questions/6393551/what-is-the-meaning-of-0-in-a-bash-script
44
cd "${0%/*}"
55

6-
# Get UI version
6+
# Get Editor version
77
EDITOR_VERSION=$(node -p "require('../package.json').version")
88

9-
# Replace our version placeholder with UI's version
10-
sed -i "s|\$\$VERSION|$EDITOR_VERSION|g" package.json
9+
# Replace our version placeholder with Editor's version
10+
sed -i.bak "s/\$\$VERSION/$EDITOR_VERSION/g" package.json
11+
rm package.json.bak
1112

1213
# Copy Editor's dist files to our directory
1314
cp ../dist/* .
1415

16+
# Copy index.html
17+
cp ../index.html .
18+
19+
# Rewire `./dist` references to `.` in index.html
20+
sed -i.bak "s/\.\/dist/\./g" index.html
21+
rm index.html.bak
22+
1523
if [ "$PUBLISH_DIST" = "true" ] || [ "$TRAVIS" = "true" ] ; then
1624
npm publish .
1725
else

0 commit comments

Comments
 (0)