Skip to content

Commit 3d4782a

Browse files
committed
Add version update script
1 parent d519565 commit 3d4782a

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

Diff for: RELEASING.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@
1414
- `shake-bench` is an internal testing tool, not exposed to the outside world. Thus, no version bump required for releases.
1515
- For updating cabal files, the following script can be used:
1616
- ```sh
17-
# Update all `version:` fields
18-
sed -ri "s/^version:( +)2.2.0.0/version:\12.3.0.0/" **/*.cabal
19-
# Update all constraints expected to be in the form `== <version>`.
20-
# We usually don't force an exact version, so this is relatively unambiguous.
21-
# We could introduce some more ad-hoc parsing, if there is still ambiguity.
22-
sed -ri "s/== 2.2.0.0/== 2.3.0.0/" **/*.cabal
17+
./release/update_versions.sh <OLD_VERSION> <NEW_VERSION>
2318
```
2419
- It still requires manual verification and review
2520
- [ ] generate and update changelog

Diff for: release/update_versions.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
function replaceHlsVersion() {
6+
# Update all `version:` fields
7+
sed -ri "s/^version:( +)${1}/version:\1${2}/" ./*.cabal ./**/*.cabal
8+
# Update all constraints expected to be in the form `== <version>`.
9+
# We usually don't force an exact version, so this is relatively unambiguous.
10+
# We could introduce some more ad-hoc parsing, if there is still ambiguity.
11+
sed -ri "s/== ${1}/== ${2}/" ./*.cabal ./**/*.cabal
12+
}
13+
14+
if [ $# -ne 2 ];
15+
then
16+
echo "USAGE: ./relase/update_versions.sh <OLD_VERSION> <NEW_VERSION>"
17+
fi
18+
19+
replaceHlsVersion "${1}" "${2}"

0 commit comments

Comments
 (0)