-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: leverage make upgrade_npmversion script to also update root
Signed-off-by: Frank Flitton <[email protected]>
- Loading branch information
1 parent
fc70a69
commit a0975cd
Showing
4 changed files
with
35 additions
and
33 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
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# Update npm version in package.json files | ||
# | ||
# Approximating functionality from: | ||
# https://github.com/semantic-release/npm/blob/master/lib/prepare.js#L14 | ||
# | ||
# This script will update the package.json version to the version provided by | ||
# the release semantic-release pipeline. | ||
# | ||
# To be used with @semantic-release/exec before @semantic-release/git. | ||
# The version should be consistent with the most recent git tag. | ||
# | ||
# Usage: ./update_npmversion.sh <version> | ||
# Example: ./update_npmversion.sh 1.0.0 | ||
# | ||
# Note: for mac users, install GNU SED and add it to your PATH variable | ||
# https://formulae.brew.sh/formula/gnu-sed | ||
|
||
|
||
# load version from args | ||
VERSION=$1 | ||
|
||
echo "Updating client-app version to: $VERSION" | ||
WEBSITE_JSON=$(realpath website/package.json) | ||
# replace contents of {"version": "x", ...} with {version: "$VERSION"} | ||
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/g" $WEBSITE_JSON | ||
|
||
echo "Updating root package version to: $VERSION" | ||
ROOT_JSON=$(realpath package.json) | ||
# replace contents of {"version": "x", ...} with {version: "$VERSION"} | ||
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/g" $ROOT_JSON |