diff options
Diffstat (limited to 'apps/installer/includes/functions.sh')
-rw-r--r-- | apps/installer/includes/functions.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/installer/includes/functions.sh b/apps/installer/includes/functions.sh index eb9fe1a24e..9dbe2652c1 100644 --- a/apps/installer/includes/functions.sh +++ b/apps/installer/includes/functions.sh @@ -1,7 +1,11 @@ #!/usr/bin/env bash # Set SUDO variable - one liner -SUDO=$([ "$EUID" -ne 0 ] && echo "sudo" || echo "") +if [[ "$OSTYPE" == "msys"* ]]; then + SUDO="" +else + SUDO=$([ "$EUID" -ne 0 ] && echo "sudo" || echo "") +fi function inst_configureOS() { echo "Platform: $OSTYPE" @@ -67,7 +71,7 @@ function inst_dbCreate() { # In CI environments or when no password is set, try without password first if [[ "$CONTINUOUS_INTEGRATION" == "true" ]]; then echo "CI environment detected, attempting connection without password..." - + if $SUDO mysql -u root < "$AC_PATH_ROOT/data/sql/create/create_mysql.sql" 2>/dev/null; then echo "Database created successfully." return 0 @@ -75,7 +79,7 @@ function inst_dbCreate() { echo "Failed to connect without password, falling back to interactive mode..." fi fi - + # Try with password (interactive mode) echo "Please enter your sudo and your MySQL root password if prompted." $SUDO mysql -u root -p < "$AC_PATH_ROOT/data/sql/create/create_mysql.sql" @@ -178,4 +182,4 @@ function inst_download_client_data { && echo "unzip downloaded file in $path..." && unzip -q -o "$zipPath" -d "$path/" \ && echo "Remove downloaded file" && rm "$zipPath" \ && echo "INSTALLED_VERSION=$VERSION" > "$dataVersionFile" -}
\ No newline at end of file +} |