Skip to content

Commit

Permalink
big fix shell
Browse files Browse the repository at this point in the history
  • Loading branch information
jayeshhireox committed Feb 26, 2025
1 parent 326d63c commit c0eb115
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
34 changes: 19 additions & 15 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,29 @@ create_or_validate_env_file() {
local current_value=${!var_name:-$default_value} # Use existing value or default

if [ -n "${!var_name}" ]; then
if zenity --question --title="Overwrite $var_name?" --text="$var_name is already set.\nDo you want to overwrite it?"; then
if [ "$hide_value" == "true" ]; then
new_value=$(zenity --password --title="Enter new value for $var_name" --text="Enter a new value:")
# If the variable is already set, ask if the user wants to overwrite it
if zenity --question --title="Overwrite $var_name?" --text="$var_name is already set.\nDo you want to overwrite it?"; then
if [ "$hide_value" == "true" ]; then
new_value=$(zenity --password --title="Enter new value for $var_name" --text="Enter a new value:")
else
new_value=$(zenity --entry --title="Enter new value for $var_name" --text="Current value: $current_value" --entry-text="$current_value")
fi
else
new_value=$(zenity --entry --title="Enter new value for $var_name" --text="Current value: $current_value" --entry-text="$current_value")
new_value="${!var_name}" # Keep the current value if not overwriting
fi
echo "$var_name=$new_value"
else
echo "$var_name=${!var_name}"
fi
else
if [ "$hide_value" == "true" ]; then
new_value=$(zenity --password --title="Enter value for $var_name" --text="No existing value found. Enter a new value:")
else
new_value=$(zenity --entry --title="Enter value for $var_name" --text="No existing value found. Enter a new value:" --entry-text="$default_value")
fi
echo "$var_name=$new_value"
# If there is no existing value, prompt for a new value
if [ "$hide_value" == "true" ]; then
new_value=$(zenity --password --title="Enter value for $var_name" --text="No existing value found. Enter a new value:")
else
new_value=$(zenity --entry --title="Enter value for $var_name" --text="No existing value found. Enter a new value:" --entry-text="$default_value")
fi
fi
}

# Return only the new value
echo "$new_value"
}


# Write the new .env file
{
Expand Down
3 changes: 3 additions & 0 deletions python/mdvtools/dbutils/mdv_server_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ def load_config(app, config_name=None, enable_auth=False):
db_name = os.getenv('DB_NAME') or read_secret('db_name')
db_host = os.getenv('DB_HOST') or app.config.get('db_host')

print("!@@@@@@@!!!!!@@@@@@@@£££££££££££££££££££")
print(db_user, db_password, db_name, db_host)

if not all([db_user, db_password, db_name, db_host]):
raise ValueError("Error: One or more required secrets or configurations are missing.")

Expand Down

0 comments on commit c0eb115

Please sign in to comment.