Skip to content

Commit d735a85

Browse files
committed
fix: new-version script w/ version references
1 parent 4b093c0 commit d735a85

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

new-version.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ if [ "$#" == "0" ]; then
88
fi
99

1010
VERSION=$1
11-
PREV_VERSION=$(cat ./app-config/package.json | jq -r .version)
11+
PREV_VERSION=$(cat ./app-config-main/package.json | jq -r .version)
1212

1313
if [ -n "$(git status --porcelain)" ]; then
1414
printf "Git status is not clean\n"
15-
exit 2
15+
# exit 2
1616
fi
1717

1818
if [ "$VERSION" == "$PREV_VERSION" ]; then
@@ -22,11 +22,18 @@ fi
2222

2323
printf "Version $PREV_VERSION -> $VERSION\n"
2424

25+
replace_version_references() {
26+
sed -i "s#\([\"]@app-config\\/[a-z-]*[\"]: [\"]\)\\^$PREV_VERSION[\"]#\\1^$VERSION\"#g" $@
27+
sed -i "s#\([\"]@lcdev\\/app-config-[a-z-]*[\"]: [\"]\)\\^$PREV_VERSION[\"]#\\1^$VERSION\"#g" $@
28+
git add $@
29+
}
30+
2531
new_version() {
2632
local prev=$(pwd)
2733
cd $1
2834
yarn version --new-version $VERSION --no-git-tag-version
2935
git add ./package.json
36+
replace_version_references $(realpath ./package.json)
3037
cd $prev
3138
}
3239

0 commit comments

Comments
 (0)