mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-22 05:12:27 +00:00
feat: Add aarch64 compatibility to start.sh and startdev.sh
This commit is contained in:
parent
c6bd16f39d
commit
5c348f9f49
20
start.sh
20
start.sh
|
@ -3,8 +3,6 @@
|
|||
rc='\033[0m'
|
||||
red='\033[0;31m'
|
||||
|
||||
binary_url="https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil"
|
||||
|
||||
check() {
|
||||
exit_code=$1
|
||||
message=$2
|
||||
|
@ -18,10 +16,26 @@ check() {
|
|||
unset message
|
||||
}
|
||||
|
||||
findArch() {
|
||||
case "$(uname -m)" in
|
||||
x86_64|amd64) arch="x86_64" ;;
|
||||
aarch64|arm64) arch="aarch64" ;;
|
||||
*) check 1 "Unsupported architecture"
|
||||
esac
|
||||
}
|
||||
|
||||
getUrl() {
|
||||
case "${arch}" in
|
||||
x86_64) echo "https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil";;
|
||||
*) echo "https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil-${arch}";;
|
||||
esac
|
||||
}
|
||||
|
||||
findArch
|
||||
temp_file=$(mktemp)
|
||||
check $? "Creating the temporary file"
|
||||
|
||||
curl -fsL "$binary_url" -o "$temp_file"
|
||||
curl -fsL "$(getUrl)" -o "$temp_file"
|
||||
check $? "Downloading linutil"
|
||||
|
||||
chmod +x "$temp_file"
|
||||
|
|
17
startdev.sh
17
startdev.sh
|
@ -24,6 +24,7 @@ redirect_to_latest_pre_release() {
|
|||
echo "Using latest Full Release"
|
||||
url="https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil"
|
||||
fi
|
||||
addArch
|
||||
echo "Using URL: $url" # Log the URL being used
|
||||
}
|
||||
|
||||
|
@ -37,6 +38,22 @@ check() {
|
|||
fi
|
||||
}
|
||||
|
||||
addArch() {
|
||||
case "${arch}" in
|
||||
x86_64);;
|
||||
*) url="${url}-${arch}";;
|
||||
esac
|
||||
}
|
||||
|
||||
findArch() {
|
||||
case "$(uname -m)" in
|
||||
x86_64|amd64) arch="x86_64" ;;
|
||||
aarch64|arm64) arch="aarch64" ;;
|
||||
*) check 1 "Unsupported architecture"
|
||||
esac
|
||||
}
|
||||
|
||||
findArch
|
||||
redirect_to_latest_pre_release
|
||||
|
||||
TMPFILE=$(mktemp)
|
||||
|
|
Loading…
Reference in New Issue
Block a user