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