Skip to content

Commit

Permalink
fix: add script to get config files on composer command
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Nov 2, 2023
1 parent 895f594 commit 8ad4398
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
17 changes: 17 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -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
Empty file added storage/json/tgn/.gitkeep
Empty file.

0 comments on commit 8ad4398

Please sign in to comment.