Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .PHONY: help install cache-clear
- .DEFAULT_GOAL = help
- INSTALLER_NODE_PACKAGES = @[ -f ./yarn.lock ] && "yarn" || "npm"
- FRAMEWORK_NAME = @[ -f ./artisan ] && "laravel" || (@[ -f ./bin/console ] && "symfony" || (@[ -f ./system/core/CodeIgniter.php ] && "codeigniter" || true))
- FRAMEWORK_BUILDER = @[ $FRAMEWORK_NAME -eq "laravel" ] && "./artisan" || (@[ $FRAMEWORK_NAME -eq "symfony" ] && "./bin/console" || true)
- help:
- @grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-10s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
- install: install.vendor install.node_modules ## Lance l'installation de l'application
- install.vendor:
- composer install
- install.node_modules: ## Lance l'installation des dépendences frontend
- # Si le package-lock.json exist et que nous utilisons Yarn, on le supprime car inutile
- @[[ $INSTALLER_NODE_PACKAGES -eq "yarn" && -f ./package-lock.json ]] && rm package-lock.json || true
- $(INSTALLER_NODE_PACKAGES) install
- build.assets: package.json
- npm run build
- cache-clear: ## Nettoie le cache
- @[ -f ./artisan ] && (php artisan cache:clear) || (@[ -f ./bin/console ] && php bin/console c:c || true)
- install.database: ## Migration de la database
- @echo $($INSTALLER_NODE_PACKAGES)
- @echo $(FRAMEWORK_NAME)
- @[ $($FRAMEWORK_NAME) -eq "laravel" ] && $FRAMEWORK_BUILDER cache:clear || echo non
- #@[ -f ./artisan ] && (php artisan migrate) || (@[ -f ./bin/console ] && php bin/console c:c || true)
Add Comment
Please, Sign In to add comment