From dd03edae6d7680aceffec2274d5bd713311ba81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Douze=20B=C3=A9?= <12b@distrilab.fr> Date: Sun, 26 May 2024 15:44:16 +0200 Subject: [PATCH] feat(yunohost extension): Add a post app install hook to update app list --- conf/sync_app_importer.sh | 2 ++ scripts/install | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 conf/sync_app_importer.sh diff --git a/conf/sync_app_importer.sh b/conf/sync_app_importer.sh new file mode 100644 index 0000000..620d6d1 --- /dev/null +++ b/conf/sync_app_importer.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +sudo -u __USER__ bash -c "cd __INSTALL_DIR__ && ./yeswicli importer:sync -s yunohost-cli" diff --git a/scripts/install b/scripts/install index a697833..e5358f3 100755 --- a/scripts/install +++ b/scripts/install @@ -99,6 +99,9 @@ chmod +x $install_dir/tools/yunohost/private/scripts/*.sh # Add app user in sudoers to authorize to launch yunohost cli commands without password ynh_add_config --template="sudoers" --destination="/etc/sudoers.d/$app" chown root:root /etc/sudoers.d/$app +ynh_add_config --template="sync_app_importer.sh" --destination="/etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh" +chown root:root /etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh +chmod +x /etc/yunohost/hooks.d/post_app_install/$app_sync_app_importer.sh # At last, run the YunoHost app importer ynh_script_progression --message="Import YunoHost apps in bazar" --weight=2