fix: No update prompt if the target folder contains an unconfigured Higress instance (#583)

This commit is contained in:
Kent Dong
2023-10-15 21:59:13 -05:00
committed by GitHub
parent f685b0353a
commit 970cfd44ee

View File

@@ -55,8 +55,8 @@ parseArgs() {
validateArgs() {
if [ -d "$DESTINATION" ]; then
if [ "$(ls -A "$DESTINATION")" -a "$MODE" != "update" ]; then
echo "The target folder \"$DESTINATION\" is not empty. Add \"-u\" to update an existed Higress instance." && exit 1
if [ -e "${DESTINATION}/compose/.configured" -a "$MODE" != "update" ]; then
echo "Higress is already installed in the target folder \"$DESTINATION\". Add \"-u\" to update an existed Higress instance." && exit 1
fi
if [ ! -w "$DESTINATION" ]; then
echo "The target folder \"$DESTINATION\" is not writeable." && exit 1