This repository was archived by the owner on Aug 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
set -e
4
4
5
- asset=" $1 "
6
- sha=" $( sha256sum " $asset " | awk ' { print $1 }' ) "
5
+ macos_asset=" $1 "
6
+ linux_asset=" $2 "
7
+
8
+ sha () {
9
+ sha256sum " $1 " | awk ' { print $1 }'
10
+ }
7
11
tag=" $( git describe --tags) "
12
+ trimmed_tag=" ${tag# " v" } "
8
13
9
14
tmpdir=$( mktemp -d)
10
15
@@ -18,12 +23,19 @@ git checkout -b "$branch"
18
23
19
24
new_formula=" $( cat << EOF
20
25
class Coder < Formula
21
- desc "A command -line tool for the Coder remote development platform"
26
+ desc "Command -line tool for the Coder remote development platform"
22
27
homepage "https://github.com/cdr/coder-cli"
23
- url "https://github.com/cdr/coder-cli/releases/download/$tag /coder-cli-darwin-amd64.zip"
24
- version "$tag "
25
- sha256 "$sha "
28
+ version "$trimmed_tag "
26
29
bottle :unneeded
30
+
31
+ if OS.mac?
32
+ url "https://github.com/cdr/coder-cli/releases/download/$tag /coder-cli-darwin-amd64.zip"
33
+ sha256 "$( sha " $macos_asset " ) "
34
+ else
35
+ url "https://github.com/cdr/coder-cli/releases/download/$tag /coder-cli-linux-amd64.tar.gz"
36
+ sha256 "$( sha " $linux_asset " ) "
37
+ end
38
+
27
39
def install
28
40
bin.install "coder"
29
41
end
36
48
37
49
echo " $new_formula " > coder.rb
38
50
51
+ git diff
39
52
git add coder.rb
40
- git commit -m " chore: update Coder CLI to $tag "
53
+ git commit -m " chore: bump Coder CLI to $tag "
41
54
git push --set-upstream origin " $branch "
42
55
43
56
gh pr create --fill
You can’t perform that action at this time.
0 commit comments