fixed setup.sh for macos support (#5336)
* fixed setup.sh for macos support * updated as per coderabbit suggestions
This commit is contained in:
parent
48cb0f5afc
commit
b05d72e29a
1 changed files with 13 additions and 4 deletions
|
|
@ -9,11 +9,20 @@ export DOCKERHUB_USER=makeplane
|
||||||
export PULL_POLICY=${PULL_POLICY:-if_not_present}
|
export PULL_POLICY=${PULL_POLICY:-if_not_present}
|
||||||
|
|
||||||
CPU_ARCH=$(uname -m)
|
CPU_ARCH=$(uname -m)
|
||||||
|
OS_NAME=$(uname)
|
||||||
|
UPPER_CPU_ARCH=$(tr '[:lower:]' '[:upper:]' <<< "$CPU_ARCH")
|
||||||
|
|
||||||
mkdir -p $PLANE_INSTALL_DIR/archive
|
mkdir -p $PLANE_INSTALL_DIR/archive
|
||||||
DOCKER_FILE_PATH=$PLANE_INSTALL_DIR/docker-compose.yaml
|
DOCKER_FILE_PATH=$PLANE_INSTALL_DIR/docker-compose.yaml
|
||||||
DOCKER_ENV_PATH=$PLANE_INSTALL_DIR/plane.env
|
DOCKER_ENV_PATH=$PLANE_INSTALL_DIR/plane.env
|
||||||
|
|
||||||
|
SED_PREFIX=()
|
||||||
|
if [ "$OS_NAME" == "Darwin" ]; then
|
||||||
|
SED_PREFIX=("-i" "")
|
||||||
|
else
|
||||||
|
SED_PREFIX=("-i")
|
||||||
|
fi
|
||||||
|
|
||||||
function print_header() {
|
function print_header() {
|
||||||
clear
|
clear
|
||||||
|
|
||||||
|
|
@ -51,12 +60,12 @@ function spinner() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function initialize(){
|
function initialize(){
|
||||||
printf "Please wait while we check the availability of Docker images for the selected release ($APP_RELEASE) with ${CPU_ARCH^^} support." >&2
|
printf "Please wait while we check the availability of Docker images for the selected release ($APP_RELEASE) with ${UPPER_CPU_ARCH} support." >&2
|
||||||
|
|
||||||
if [ "$CUSTOM_BUILD" == "true" ]; then
|
if [ "$CUSTOM_BUILD" == "true" ]; then
|
||||||
echo "" >&2
|
echo "" >&2
|
||||||
echo "" >&2
|
echo "" >&2
|
||||||
echo "${CPU_ARCH^^} images are not available for selected release ($APP_RELEASE)." >&2
|
echo "${UPPER_CPU_ARCH} images are not available for selected release ($APP_RELEASE)." >&2
|
||||||
echo "build"
|
echo "build"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
@ -78,7 +87,7 @@ function initialize(){
|
||||||
else
|
else
|
||||||
echo "" >&2
|
echo "" >&2
|
||||||
echo "" >&2
|
echo "" >&2
|
||||||
echo "${CPU_ARCH^^} images are not available for selected release ($APP_RELEASE)." >&2
|
echo "${UPPER_CPU_ARCH} images are not available for selected release ($APP_RELEASE)." >&2
|
||||||
echo "" >&2
|
echo "" >&2
|
||||||
echo "build"
|
echo "build"
|
||||||
return 1
|
return 1
|
||||||
|
|
@ -122,7 +131,7 @@ function updateEnvFile() {
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
# if key exists, update the value
|
# if key exists, update the value
|
||||||
sed -i "s/^$key=.*/$key=$value/g" "$file"
|
sed "${SED_PREFIX[@]}" "s/^$key=.*/$key=$value/g" "$file"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "File not found: $file"
|
echo "File not found: $file"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue