From dc65d983dfc24214bf602c9586be65b356321aee Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 4 Dec 2023 13:19:13 +0100 Subject: [PATCH] use ynh_setup_source to install font --- manifest.toml | 4 ++++ scripts/install | 12 ++---------- scripts/upgrade | 12 ++---------- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/manifest.toml b/manifest.toml index 722864d..72f5f2b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -55,6 +55,10 @@ ram.runtime = "50M" autoupdate.strategy = "latest_github_tag" + [resources.sources.fonts] + url = "https://github.com/adobe-fonts/source-han-sans/raw/release/Variable/OTC/SourceHanSans-VF.ttf.ttc" + sha256 = "" + [resources.system_user] allow_email = true diff --git a/scripts/install b/scripts/install index 00134ff..7bbe6ba 100755 --- a/scripts/install +++ b/scripts/install @@ -18,7 +18,8 @@ ynh_app_setting_set --app=$app --key=key --value=$key ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" +ynh_setup_source --dest_dir="$install_dir" --source_id="main" +ynh_setup_source --dest_dir="$install_dir/static/fonts/source_han_sans" --source_id="fonts" # Set permissions to app files chmod -R o-rwx "$install_dir" @@ -49,15 +50,6 @@ $install_dir/venv/bin/python3 "$install_dir/manage.py" initdb $install_dir/venv/bin/python3 "$install_dir/manage.py" compile_themes $install_dir/venv/bin/python3 "$install_dir/manage.py" collectstatic --no-input -#================================================= -# INSTALL SOURCE HAN SANS FONT -#================================================= -ynh_script_progression --message="Installing Source Han Sans font..." --weight=1 - -pushd $install_dir/static/fonts/source_han_sans -ynh_exec_warn_less wget https://github.com/adobe-fonts/source-han-sans/raw/release/Variable/OTC/SourceHanSans-VF.ttf.ttc -popd - #================================================= # NGINX CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a5be43f..d6862df 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -45,7 +45,8 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep=".env" + ynh_setup_source --dest_dir="$install_dir" --source_id="main" --keep=".env" + ynh_setup_source --dest_dir="$install_dir/static/fonts/source_han_sans" --source_id="fonts" fi chmod 750 "$install_dir" @@ -85,15 +86,6 @@ $install_dir/venv/bin/python3 "$install_dir/manage.py" populate_streams $install_dir/venv/bin/python3 "$install_dir/manage.py" makemigrations --merge --noinput $install_dir/venv/bin/python3 "$install_dir/manage.py" migrate -#================================================= -# INSTALL SOURCE HAN SANS FONT -#================================================= -ynh_script_progression --message="Installing Source Han Sans font..." --weight=1 - -pushd $install_dir/static/fonts/source_han_sans -ynh_exec_warn_less wget https://github.com/adobe-fonts/source-han-sans/raw/release/Variable/OTC/SourceHanSans-VF.ttf.ttc -popd - #================================================= # SET PERMISSIONS ON BOOKWYRM DIRECTORY #=================================================