From e12e1da6453b628bd31ded51023bdbf28cb0b481 Mon Sep 17 00:00:00 2001 From: oleole39 <59071673+oleole39@users.noreply.github.com> Date: Mon, 5 Feb 2024 05:57:09 +0100 Subject: [PATCH] fix broken download link in the UI --- scripts/install | 5 +++++ scripts/upgrade | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index cac142f..ef090a2 100755 --- a/scripts/install +++ b/scripts/install @@ -19,7 +19,12 @@ index_page="CyberChef_v${upstream_version}.html" #================================================= ynh_script_progression --message="Setting up source files..." --weight=10 +sources_json=$(cat $YNH_APP_BASEDIR/manifest.toml | toml_to_json | jq ".resources.sources[\"main\"]") +upstream_source_url=$(echo $sources_json | jq -r .url) +source_filename=$(basename $upstream_source_url) +index_html_page=$(basename -s .zip $upstream_source_url).html ynh_setup_source --dest_dir="$install_dir" +sed -i "s|$source_filename|$upstream_source_url|g" "$install_dir/$index_html_page" #replace local link to source file with upstream source file's link chown -R $app:www-data "$install_dir" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7b42b27..85e551d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,9 +23,13 @@ index_page="CyberChef_v${upstream_version}.html" if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=10 - - # Download, check integrity, uncompress and patch the source from app.src + sources_json=$(cat $YNH_APP_BASEDIR/manifest.toml | toml_to_json | jq ".resources.sources[\"main\"]") + upstream_source_url=$(echo $sources_json | jq -r .url) + source_filename=$(basename $upstream_source_url) + index_html_page=$(basename -s .zip $upstream_source_url).html ynh_setup_source --dest_dir="$install_dir" + sed -i "s|$source_filename|$upstream_source_url|g" "$install_dir/$index_html_page" #replace local link to source file with upstream source file's link + chown -R $app:www-data "$install_dir" fi chown -R $app:www-data "$install_dir"