-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix semantic-release dist-tag (#319)
Fix semantic-release config so that it correctly adds a dist-tag to the published npm package. Fix so it commits the updated package.json version
- Loading branch information
Jeremy Trujillo
committed
Jun 13, 2018
1 parent
cc77b27
commit e12335c
Showing
6 changed files
with
87 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
package.json | ||
package-lock.json | ||
CHANGELOG.md | ||
/coverage | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -z "$1" ]; then | ||
echo "Must pass package version as first argument" | ||
exit 1 | ||
fi | ||
|
||
# Grab package version set by semantic release | ||
PACKAGE_VERSION=$(cat dist/cashmere/package.json \ | ||
| grep version \ | ||
| head -1 \ | ||
| awk -F: '{ print $2 }' \ | ||
| sed 's/[",]//g') | ||
PACKAGE_VERSION=$1 | ||
|
||
# Replace package.json version with generated version | ||
sed -i "" -E "s/(\"version\":[[:space:]]*\").+(\")/\1${PACKAGE_VERSION}\2/g" package.json | ||
|
||
# Update package-lock.json version also | ||
npm install --package-lock-only | ||
sed -i "" -E "s/(\"version\":[[:space:]]*\").+(\")/\1${PACKAGE_VERSION}\2/g" package-lock.json |