2023-01-17 21:35:35 +00:00
|
|
|
#!/bin/bash
|
|
|
|
case "$(uname)" in
|
|
|
|
|
|
|
|
"Darwin")
|
|
|
|
SYSTEM="apple-darwin"
|
|
|
|
case $(uname -m) in
|
|
|
|
"arm64")
|
|
|
|
TARGET="aarch64-$SYSTEM"
|
|
|
|
;;
|
|
|
|
"x86_64")
|
|
|
|
TARGET="x86_64-$SYSTEM"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unsuported target"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
"Linux")
|
|
|
|
SYSTEM="unknown-linux-gnu"
|
|
|
|
case $(uname -m) in
|
|
|
|
"x86_64")
|
|
|
|
TARGET="x86_64-$SYSTEM"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unsuported target"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Signal number $1 is not processed"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
LATEST_VERSION="v$(curl -s https://raw.githubusercontent.com/allanger/clever-install/main/Cargo.toml | awk -F ' = ' '$1 ~ /version/ { gsub(/[\"]/, "", $2); printf("%s",$2); exit}')"
|
|
|
|
echo "Downloading $LATEST_VERSION"
|
|
|
|
|
2023-02-09 11:06:05 +00:00
|
|
|
RELEASE_NAME=dudo-$LATEST_VERSION-$TARGET
|
2023-01-17 21:35:35 +00:00
|
|
|
RELEASE_URL="https://github.com/allanger/clever-install/releases/download/$LATEST_VERSION/$RELEASE_NAME"
|
|
|
|
echo "Link for downloading: $RELEASE_URL"
|
|
|
|
curl -LJO $RELEASE_URL
|
|
|
|
|
2023-02-09 11:06:05 +00:00
|
|
|
mv $RELEASE_NAME dudo
|
|
|
|
chmod +x dudo
|
2023-01-17 21:35:35 +00:00
|
|
|
|
2023-02-09 11:06:05 +00:00
|
|
|
echo 'Make sure that dudo is in your $PATH'
|
2023-01-17 21:35:35 +00:00
|
|
|
echo 'Try: '
|
|
|
|
echo ' $ export PATH=$PATH:$PWD'
|
2023-02-09 11:06:05 +00:00
|
|
|
echo ' $ dudo -h'
|