Guest User

Untitled

a guest
Aug 17th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. .PHONY: help install cache-clear
  2. .DEFAULT_GOAL = help
  3.  
  4. INSTALLER_NODE_PACKAGES = @[ -f ./yarn.lock ] && "yarn" || "npm"
  5. FRAMEWORK_NAME = @[ -f ./artisan ] && "laravel" || (@[ -f ./bin/console ] && "symfony" || (@[ -f ./system/core/CodeIgniter.php ] && "codeigniter" || true))
  6. FRAMEWORK_BUILDER = @[ $FRAMEWORK_NAME -eq "laravel" ] && "./artisan" || (@[ $FRAMEWORK_NAME -eq "symfony" ] && "./bin/console" || true)
  7.  
  8. help:
  9. @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/'
  10.  
  11. install: install.vendor install.node_modules ## Lance l'installation de l'application
  12.  
  13. install.vendor:
  14. composer install
  15.  
  16. install.node_modules: ## Lance l'installation des dépendences frontend
  17. # Si le package-lock.json exist et que nous utilisons Yarn, on le supprime car inutile
  18. @[[ $INSTALLER_NODE_PACKAGES -eq "yarn" && -f ./package-lock.json ]] && rm package-lock.json || true
  19. $(INSTALLER_NODE_PACKAGES) install
  20.  
  21. build.assets: package.json
  22. npm run build
  23.  
  24. cache-clear: ## Nettoie le cache
  25. @[ -f ./artisan ] && (php artisan cache:clear) || (@[ -f ./bin/console ] && php bin/console c:c || true)
  26.  
  27. install.database: ## Migration de la database
  28. @echo $($INSTALLER_NODE_PACKAGES)
  29. @echo $(FRAMEWORK_NAME)
  30. @[ $($FRAMEWORK_NAME) -eq "laravel" ] && $FRAMEWORK_BUILDER cache:clear || echo non
  31. #@[ -f ./artisan ] && (php artisan migrate) || (@[ -f ./bin/console ] && php bin/console c:c || true)
Add Comment
Please, Sign In to add comment