diff --git a/composer.json b/composer.json index b7526b7..fccc4e0 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,13 @@ "scripts": { "analyse": "vendor/bin/phpstan", "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes", - "test": "vendor/bin/pest" + "test": "vendor/bin/pest", + "post-install-cmd": [ + "bash ./install.sh" + ], + "post-update-cmd": [ + "bash ./install.sh" + ] }, "support": { "issues": "https://github.com/lbiltech/telegram-git-notifier/issues" diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..9775fec --- /dev/null +++ b/install.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +json_files=( + "github-events.json" + "gitlab-events.json" + "tgn-settings.json" +) + +for file in "${json_files[@]}"; do + if [ ! -f "storage/json/tgn/$file" ]; then + cp "./config/jsons/$file" "storage/json/tgn/$file" + fi +done + +if [[ "$(uname -s -r)" == *"Linux"* && "$(cat /etc/os-release)" == *"Ubuntu"* ]]; then + chmod 777 storage/json/tgn/*.json +fi diff --git a/storage/json/tgn/.gitkeep b/storage/json/tgn/.gitkeep new file mode 100644 index 0000000..e69de29