Skip to content

Commit fb82308

Browse files
authored
Update install.sh
解决无法下载问题
1 parent 24bcd13 commit fb82308

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ type java >/dev/null 2>&1 || {
3232
repo="excel-code-generator/code-generator"
3333
repoPath="https://github.com/$repo"
3434
rawPath="https://raw.githubusercontent.com/$repo"
35+
apiPath="https://api.github.com/repos/$repo/releases/latest"
3536

3637
# latest version
3738
echo "Get the latest version"
38-
tag=`curl --silent "$repoPath/releases/latest" | sed 's#.*tag/\(.*\)".*#\1#'`
39+
tag=`curl --silent $apiPath | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g'
3940
echo "Latest version: $tag"
4041
4142
# download

0 commit comments

Comments
 (0)