diff --git a/manifest.json b/manifest.json index 2314e12..7ec8807 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,7 @@ "description": { "en": "A modern, convivial and free music server" }, - "version": "0.17.0~ynh2", + "version": "0.17.0~ynh3", "url": "https://funkwhale.audio", "license": "BSD-3-Clause", "maintainer": { @@ -47,4 +47,4 @@ } ] } -} +} \ No newline at end of file diff --git a/scripts/install b/scripts/install index 767341f..2e03ddc 100644 --- a/scripts/install +++ b/scripts/install @@ -172,12 +172,16 @@ ynh_replace_string "__DBNAME__" "$app" "$configfile" ynh_replace_string "__FINALPATH__" "$final_path" "$configfile" ynh_replace_string "__KEY__" "$key" "$configfile" -cat > "$final_path/code/load_env" <<'EOL' +loadfile="$final_path/code/load_env" + +cat > "$loadfile" <<'EOL' #!/bin/bash -export $(cat "$final_path/code/config/.env" | grep -v ^# | xargs) +export $(cat "__FINALPATH__/code/config/.env" | grep -v ^# | xargs) EOL -chmod +x "$final_path/code/load_env" +chmod +x "$loadfile" + +ynh_replace_string "__FINALPATH__" "$final_path" "$loadfile" #================================================= # MODIFY THE CONFIG FILE @@ -187,7 +191,7 @@ admin_mail=$(ynh_user_get_info "$admin" "mail") ( set +o nounset source "${final_path}/code/virtualenv/bin/activate" - source "${final_path}/code/load_env" + source "$loadfile" set -o nounset cd "$final_path/code/" diff --git a/scripts/upgrade b/scripts/upgrade index 5c92527..1bd9d5b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -175,12 +175,16 @@ ynh_replace_string "__DBNAME__" "$app" "$configfile" ynh_replace_string "__FINALPATH__" "$final_path" "$configfile" ynh_replace_string "__KEY__" "$key" "$configfile" -cat > "$final_path/code/load_env" <<'EOL' +loadfile="$final_path/code/load_env" + +cat > "$loadfile" <<'EOL' #!/bin/bash -export $(cat "$final_path/code/config/.env" | grep -v ^# | xargs) +export $(cat "__FINALPATH__/code/config/.env" | grep -v ^# | xargs) EOL -chmod +x "$final_path/code/load_env" +chmod +x "$loadfile" + +ynh_replace_string "__FINALPATH__" "$final_path" "$loadfile" #================================================= # MIGRATE @@ -189,7 +193,7 @@ chmod +x "$final_path/code/load_env" ( set +o nounset source "${final_path}/code/virtualenv/bin/activate" - source "${final_path}/code/load_env" + source "$loadfile" set -o nounset cd "$final_path/code"