From 5e63fc1788ddddec2da2d687047f74cb6876c0c9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 12 Jun 2021 09:47:21 +0200 Subject: [PATCH] set src --- conf/app.src | 7 +++++++ scripts/install | 5 ++--- scripts/upgrade | 4 +++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/conf/app.src b/conf/app.src index e69de29..b3b1951 100644 --- a/conf/app.src +++ b/conf/app.src @@ -0,0 +1,7 @@ +SOURCE_URL=https://github.com/iv-org/invidious/archive/a0fb75efcb14f95f44e427db9cae0d0c03ccfa2a.tar.gz +SOURCE_SUM=eadb72ad3b61cbfebbe5b32d011a312e6e9bb093680cb2916547bf49dab0b0a1 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= +SOURCE_EXTRACT=true diff --git a/scripts/install b/scripts/install index eead517..31b9695 100644 --- a/scripts/install +++ b/scripts/install @@ -97,9 +97,8 @@ ynh_psql_setup_db --db_user=$db_name --db_name=$db_name ynh_script_progression --message="Setting up source files..." --weight=4 ynh_app_setting_set --app=$app --key=final_path --value=$final_path - -# Download, check integrity, uncompress and patch the source from GitHub -git clone https://github.com/iv-org/invidious "$final_path" --quiet +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$final_path" for i in $final_path/config/sql/*.sql ; do ynh_replace_string --match_string="kemal" --replace_string=$db_user --target_file="$i" ; diff --git a/scripts/upgrade b/scripts/upgrade index 160e85b..6420030 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -102,7 +102,9 @@ then # Remove the app directory securely ynh_secure_remove --file=$final_path - git clone https://github.com/iv-org/invidious "$final_path" --quiet + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$final_path" + pushd "$final_path" || ynh_die shards update && shards install crystal build $final_path/src/invidious.cr --release