X Tutup
Skip to content

Commit 2376c81

Browse files
committed
Fix scoop-gen
1 parent 4195663 commit 2376c81

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

script/scoop-gen

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,29 @@
33
set -e
44

55
tagname="${1?}"
6-
version="${tagname#v}"
7-
urlprefix="https://github.com/cli/cli/releases/download/$tagname/"
86
jsonfile="${2?}"
97

108
jq_args=(
11-
--arg version "$version"
9+
--arg version "${tagname#v}"
10+
--arg urlprefix "https://github.com/cli/cli/releases/download/$tagname/"
1211
$(cat | awk '
1312
/windows_386/ {
14-
printf "--arg win32hash \"%s\"\n", $1
15-
printf "--arg win32file \"%s\"\n", $2
13+
printf "--arg win32hash %s\n", $1
14+
printf "--arg win32file %s\n", $2
1615
}
1716
/windows_amd64/ {
18-
printf "--arg win64hash \"%s\"\n", $1
19-
printf "--arg win64file \"%s\"\n", $2
17+
printf "--arg win64hash %s\n", $1
18+
printf "--arg win64file %s\n", $2
2019
}
2120
')
2221
)
2322

2423
jq '
2524
.version = $version |
26-
.architecture."32bit".url = $win32file |
25+
.architecture."32bit".url = $urlprefix + $win32file |
2726
.architecture."32bit".hash = $win32hash |
28-
.architecture."64bit".url = $win64file |
27+
.architecture."64bit".url = $urlprefix + $win64file |
2928
.architecture."64bit".hash = $win64hash
3029
' "${jq_args[@]}" --indent 4 "$jsonfile" > "$jsonfile"~
30+
31+
mv "$jsonfile"{~,}

0 commit comments

Comments
 (0)
X Tutup