File tree 1 file changed +25
-0
lines changed
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Updates both the coder-cli and coder-cli-nightly formulae to have the given
4
+ # values.
5
+ # ./update.sh "<version>" "<darwin-arm64-zip-SHA256>" "<darwin-amd64-zip-SHA256>" "<linux-amd64-targz-SHA256>"
6
+
7
+ set -euo pipefail
8
+ cd " $( dirname " $0 " ) "
9
+
10
+ version=" $1 "
11
+ darwin_arm_sha=" $( echo " $2 " | tr " [:upper:]" " [:lower:]" ) "
12
+ darwin_intel_sha=" $( echo " $3 " | tr " [:upper:]" " [:lower:]" ) "
13
+ linux_sha=" $( echo " $4 " | tr " [:upper:]" " [:lower:]" ) "
14
+
15
+ # Replace version
16
+ sed -i " s/version \" [0-9.]*\" /version \" $version \" /g" " ../Formula/coder.rb"
17
+
18
+ # Update macOS ARM hash
19
+ sed -zi " s/sha256 \" [a-f0-9]*\" /sha256 \" $darwin_arm_sha \" /1" " ../Formula/coder.rb"
20
+
21
+ # Update macOS Intel hash
22
+ sed -zi " s/sha256 \" [a-f0-9]*\" /sha256 \" $darwin_intel_sha \" /2" " ../Formula/coder.rb"
23
+
24
+ # Update Linux hash
25
+ sed -zi " s/sha256 \" [a-f0-9]*\" /sha256 \" $linux_sha \" /3" " ../Formula/coder.rb"
You can’t perform that action at this time.
0 commit comments