From 7283d91c8c4071ac178ba25eda0b7f660edede25 Mon Sep 17 00:00:00 2001 From: peterxcli Date: Wed, 28 Feb 2024 02:00:34 +0800 Subject: [PATCH] feat: Add dev-sync command to Makefile and run.sh --- Makefile | 3 +++ script/run.sh | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 77767e5..6bf0583 100644 --- a/Makefile +++ b/Makefile @@ -58,3 +58,6 @@ bot: ## Run the bot prod-up: ## Start the container for production ./script/run.sh prod start + +dev-sync: ## Load the dev environment variables + ./script/run.sh dev sync \ No newline at end of file diff --git a/script/run.sh b/script/run.sh index 36c9746..5ce1216 100755 --- a/script/run.sh +++ b/script/run.sh @@ -74,7 +74,7 @@ case "$action" in fi ;; - migrate|run|serve|test|bot) + migrate|run|serve|test|bot|sync) export_env $mode if [ "$action" = "migrate" ]; then go run ./cmd/migrate/migrate.go @@ -86,6 +86,8 @@ case "$action" in air elif [ "$action" = "test" ]; then go test -v -cover ./... + elif [ "$action" = "sync" ]; then + go run ./cmd/sync/main.go else echo "Error: Invalid command. Choose from (generate | migrate | run | serve)" exit 1