Skip to content

Commit

Permalink
chore: use sh not bash
Browse files Browse the repository at this point in the history
  • Loading branch information
healthjyk committed Dec 27, 2023
1 parent 238b1f6 commit 342a70c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
24 changes: 15 additions & 9 deletions static/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh

# ------------------------------------------------------------
# Copyright 2022 The KusionStack Authors
Expand All @@ -17,7 +17,6 @@

set -o errexit
set -o nounset
set -o pipefail

# Sudo is required to copy binary to KUSION_HOME_DIR
USE_SUDO=${USE_SUDO:-"false"}
Expand Down Expand Up @@ -95,15 +94,22 @@ getSystemInfo() {
}

verifySupported() {
local supported=(darwin-amd64 linux-amd64 darwin-arm64)
local current_os_arch="${OS}-${ARCH}"

for osarch in "${supported[@]}"; do
if [ "$osarch" == "$current_os_arch" ]; then
info "Your system is ${OS}_${ARCH}."
return
fi
done
if [ "${current_os_arch}" == "darwin-amd64" ]; then
info "Your system is ${current_os_arch}."
return
fi

if [ "${current_os_arch}" == "darwin-arm64" ]; then
info "Your system is ${current_os_arch}."
return
fi

if [ "${current_os_arch}" == "linux-amd64" ]; then
info "Your system is ${current_os_arch}."
return
fi

error "No prebuilt installation package for ${current_os_arch}"
exit 1
Expand Down
3 changes: 1 addition & 2 deletions static/scripts/uninstall.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh

# ------------------------------------------------------------
# Copyright 2022 The KusionStack Authors
Expand All @@ -15,7 +15,6 @@

set -o errexit
set -o nounset
set -o pipefail

# Sudo is required to delete binary from KUSION_HOME_DIR
USE_SUDO=${USE_SUDO:-"false"}
Expand Down

0 comments on commit 342a70c

Please sign in to comment.