From 88889e03b22030cd38acaff30ce5f04680ca9a3c Mon Sep 17 00:00:00 2001 From: Tan Nguyen Date: Fri, 2 Aug 2024 13:11:04 +0700 Subject: [PATCH] refactor: elasticsearch import scout function --- setup/functions.sh | 7 +++++++ setup/handlers.sh | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/setup/functions.sh b/setup/functions.sh index 3056209..56e9489 100644 --- a/setup/functions.sh +++ b/setup/functions.sh @@ -58,3 +58,10 @@ source_implement() { " fi } + +scout_import() { + docker compose run --rm -w /var/dev/blog-admin php83 ash -l -c "\ + php artisan scout:import \ + \"CSlant\Blog\Core\Models\User\" \ + " +} diff --git a/setup/handlers.sh b/setup/handlers.sh index bbc3e4f..cfbcc4d 100644 --- a/setup/handlers.sh +++ b/setup/handlers.sh @@ -50,8 +50,5 @@ elasticsearch_import() { cd "$CURRENT_DIR" || exit echo "◎ Importing Elasticsearch data..." - docker compose run --rm -w /var/dev/blog-admin php83 ash -l -c "\ - php artisan scout:import \ - \"CSlant\Blog\Core\Models\User\" \ - " + scout_import }