From b9b534b63c83423743d2820defd26f4da0de7b58 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Sun, 8 Sep 2024 05:37:18 +0500 Subject: [PATCH] support for node --- helper | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/helper b/helper index 74f47d4..0c76626 100755 --- a/helper +++ b/helper @@ -2,11 +2,7 @@ # Function to handle PHP Artisan commands php() { - if [[ "$1" == "artisan" ]]; then - docker compose exec fpm php artisan "${@:2}" - else - echo "Unknown php command" - fi + docker compose exec fpm "${@}" } # Function to handle Composer commands @@ -28,6 +24,11 @@ fix_storage() { docker compose exec fpm chmod -R ug+x bootstrap/cache } +# Function to handle NPM commands +npm() { + docker compose exec node npm "${@}" +} + # Function to initialize the composer.yml file init() { cat < composer.yml @@ -61,6 +62,12 @@ services: - MYSQL_DATABASE=cusport volumes: - ./.db:/var/lib/mysql + node: + hostname: node + image: node:lts + volumes: + - ./:/var/www/html/ + working_dir: /var/www/html EOL echo "composer.yml file created successfully!" }