diff --git a/build.ab b/build.ab index 1f2790d9..de30c79c 100644 --- a/build.ab +++ b/build.ab @@ -18,6 +18,9 @@ if $echo \$?$ == '0' { $mv target/aarch64-unknown-linux-musl/release/amber target/release/amber_linux_aarch64$ $mv target/x86_64-apple-darwin/release/amber target/release/amber_macos_x86_64$ $mv target/x86_64-unknown-linux-musl/release/amber target/release/amber_linux_x86_64$ + # Recompile installer scripts + $cargo run -- setup/install.ab setup/install.sh$ + $cargo run -- setup/uninstall.ab setup/uninstall.sh$ } else { $echo "Please run this command in the project root directory"$ } \ No newline at end of file diff --git a/setup/install.ab b/setup/install.ab index 2b8418e4..b51cae99 100644 --- a/setup/install.ab +++ b/setup/install.ab @@ -3,25 +3,15 @@ let target = 'amber' let tag = 'v0.1.1-alpha' let place = '/opt/amber' -# Detect OS type -let arch = '' -let os = '' - # Determine OS type -if $uname -s$ == 'Darwin' { - os = 'macos' -} -else { - os = 'linux' -} +let os = $uname -s$ == 'Darwin' + then 'macos' + else 'linux' # Determine architecture -if $uname -m$ == 'arm64' { - arch = 'aarch64' -} -else { - arch = 'x86_64' -} +let arch = $uname -m$ == 'arm64' + then 'aarch64' + else 'x86_64' # Set the download link let url = 'https://github.com/Ph0enixKM/{name}/releases/download/{tag}/amber_{os}_{arch}' diff --git a/setup/install.sh b/setup/install.sh index aa077fbe..cb6dc57a 100755 --- a/setup/install.sh +++ b/setup/install.sh @@ -2,18 +2,8 @@ name="AmberNative"; target="amber"; tag="v0.1.1-alpha"; place="/opt/amber"; -arch=""; -os=""; -if [ $([ "_$(uname -s)" != "_Darwin" ]; echo $?) != 0 ]; then -os="macos" -else -os="linux" -fi; -if [ $([ "_$(uname -m)" != "_arm64" ]; echo $?) != 0 ]; then -arch="aarch64" -else -arch="x86_64" -fi; +os=$(if [ $([ "_$(uname -s)" != "_Darwin" ]; echo $?) != 0 ]; then echo "macos"; else echo "linux"; fi); +arch=$(if [ $([ "_$(uname -m)" != "_arm64" ]; echo $?) != 0 ]; then echo "aarch64"; else echo "x86_64"; fi); url="https://github.com/Ph0enixKM/${name}/releases/download/${tag}/amber_${os}_${arch}"; test -d "${place}" > /dev/null; if [ $([ "_$(echo $?)" != "_0" ]; echo $?) != 0 ]; then