Skip to content

Commit

Permalink
scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
cnk3x committed Jan 7, 2022
1 parent 824f798 commit b489e25
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions build.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
#!/usr/bin/env sh

set -eu

version=$(cat target/version)

echo $version
CGO_ENABLED=0 go build -trimpath -ldflags='-s -w -extldflags "-static"' -o bin/xunlei ./

if command -v upx >/dev/null; then
upx bin/xunlei
fi

tgz="xunlei-v${version}.$(uname | tr 'A-Z' 'a-z').$(uname -m).tar.gz"
echo $tgz
tar -C bin -cf bin/$tgz xunlei
tar -tf bin/$tgz
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eu

latest=$(curl -fsSL https://gh.k3x.cn/api/repos/cnk3x/xunlei-from-syno/releases/latest | grep browser_download_url | grep $(uname -m) | head -n 1 | grep -Eo https.+.tar.gz | sed 's/github.com/gh.k3x.cn/g')
latest=$(curl -fsSL https://gh.k3x.cn/api/repos/cnk3x/xunlei/releases/latest | grep browser_download_url | grep $(uname -m) | head -n 1 | grep -Eo https.+.tar.gz | sed 's/github.com/gh.k3x.cn/g')
curl -fsSL ${latest} | tar zx
./xunlei $@

Expand Down

0 comments on commit b489e25

Please sign in to comment.