-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
vilmibm
committed
Aug 25, 2021
1 parent
cead3ab
commit 9fb5e40
Showing
8 changed files
with
47 additions
and
25 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,53 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
repo="vilmibm/gh-user-status" | ||
tag="v1.0.0" | ||
|
||
extensionPath="$(dirname "$0")" | ||
arch="$(uname -m)" | ||
|
||
exe="" | ||
|
||
if uname -a | grep Msys > /dev/null; then | ||
if [ $arch = "x86_64" ]; then | ||
exec "${extensionPath}/builds/windows-x86_64" "$@" | ||
exe="windows-x86_64" | ||
elif [ $arch = "i686" ]; then | ||
exec "${extensionPath}/builds/windows-i386" "$@" | ||
exe="windows-i386" | ||
elif [ $arch = "i386" ]; then | ||
exec "${extensionPath}/builds/windows-i386" "$@" | ||
exe="windows-i386" | ||
fi | ||
elif uname -a | grep Darwin > /dev/null; then | ||
if [ $arch = "x86_64" ]; then | ||
exec "${extensionPath}/builds/darwin-x86_64" "$@" | ||
exe="darwin-x86_64" | ||
fi | ||
elif uname -a | grep Linux > /dev/null; then | ||
if [ $arch = "x86_64" ]; then | ||
exec "${extensionPath}/builds/linux-x86_64" "$@" | ||
exe="linux-x86_64" | ||
elif [ $arch = "i686" ]; then | ||
exec "${extensionPath}/builds/linux-i386" "$@" | ||
exe="linux-i386" | ||
elif [ $arch = "i386" ]; then | ||
exec "${extensionPath}/builds/linux-i386" "$@" | ||
exe="linux-i386" | ||
fi | ||
fi | ||
|
||
if [ "$(which go)" = "" ]; then | ||
echo "go must be installed to use this gh extension on this platform" | ||
exit 1 | ||
fi | ||
if [ "${exe}" == "" ]; then | ||
if [ "$(which go)" = "" ]; then | ||
echo "go must be installed to use this gh extension on this platform" | ||
exit 1 | ||
fi | ||
|
||
exe="cmd.out" | ||
exe="cmd.out" | ||
|
||
cd "${extensionPath}" > /dev/null | ||
go build -o "${exe}" | ||
cd - > /dev/null | ||
cd "${extensionPath}" > /dev/null | ||
go build -o "${exe}" | ||
cd - > /dev/null | ||
else | ||
if [[ ! -x "${extensionPath}/${exe}" ]]; then | ||
rm -f "${extensionPath}/${exe}" | ||
gh release -R"${repo}" download "${tag}" -p "${exe}" --dir="${extensionPath}" | ||
chmod +x "${extensionPath}/${exe}" | ||
fi | ||
fi | ||
|
||
exec "${extensionPath}/${exe}" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# TODO ARM support. figure out mapping to uname -m output. | ||
|
||
tag="${1}" | ||
|
||
if [ "${tag}" == "" ]; then | ||
echo "tag argument required" | ||
exit 1 | ||
fi | ||
|
||
rm -rf dist | ||
GOOS=darwin GOARCH=amd64 go build -o dist/darwin-x86_64 | ||
GOOS=linux GOARCH=386 go build -o dist/linux-i386 | ||
GOOS=linux GOARCH=amd64 go build -o dist/linux-x86_64 | ||
GOOS=windows GOARCH=386 go build -o dist/windows-i386 | ||
GOOS=windows GOARCH=amd64 go build -o dist/windows-x86_64 | ||
|
||
gh release create $tag ./dist/* --title="${tag}" --notes "${tag}" |