mirror of
https://github.com/YunoHost-Apps/cyberchef_ynh.git
synced 2024-09-03 18:16:31 +02:00
fix broken download link in the UI
This commit is contained in:
parent
df02743c02
commit
e12e1da645
2 changed files with 11 additions and 2 deletions
|
@ -19,7 +19,12 @@ index_page="CyberChef_v${upstream_version}.html"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up source files..." --weight=10
|
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"
|
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"
|
chown -R $app:www-data "$install_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -23,9 +23,13 @@ index_page="CyberChef_v${upstream_version}.html"
|
||||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=10
|
ynh_script_progression --message="Upgrading source files..." --weight=10
|
||||||
|
sources_json=$(cat $YNH_APP_BASEDIR/manifest.toml | toml_to_json | jq ".resources.sources[\"main\"]")
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
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"
|
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
|
fi
|
||||||
|
|
||||||
chown -R $app:www-data "$install_dir"
|
chown -R $app:www-data "$install_dir"
|
||||||
|
|
Loading…
Add table
Reference in a new issue