From 3a853564c11b2cb6dafb19d6d40264741682647c Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Sat, 10 Dec 2022 21:59:01 +0800 Subject: [PATCH] phptools --- Makefile | 17 ++++++++++++++--- install/composer-clean | 2 +- install/php-tools-only | 41 +++++++++++++++++++++++++++++++++++++++++ packs/phptools | 2 ++ 4 files changed, 58 insertions(+), 4 deletions(-) create mode 100755 install/php-tools-only create mode 100644 packs/phptools diff --git a/Makefile b/Makefile index e190775..e392c33 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Autogenerated at 09.10.2022 12:57 using ./gen-makefile +# Autogenerated at 10.12.2022 21:58 using ./gen-makefile .DEFAULT_GOAL := help #=============================================== @@ -22,6 +22,9 @@ omz: zsh omz-clean omz-fancy chsh -s /usr/bin/zsh @exec zsh +# [PACK] php + composer + phpunit + psalm + phpcs + php-cs-fixer +phptools: php composer-clean php-tools-only + #=============================================== # Scripts listed in ./install #=============================================== @@ -98,7 +101,7 @@ kde-portal: libreoffice: @./install/libreoffice -# Install lite-xl v2.0.5 (draft) +# Install lite-xl lite-xl: @./install/lite-xl @@ -138,6 +141,10 @@ pgsql: php: @./install/php +# Install phpunit + psalm + phpcs + php-cs-fixer +php-tools-only: + @./install/php-tools-only + # Install postman (latest) postman: @./install/postman @@ -174,7 +181,7 @@ vivaldi: wine: @./install/wine -# Install youtube-dl + ytdlcue +# Install youtube-dl youtube-dl: @./install/youtube-dl @@ -206,6 +213,10 @@ zsh: /docker: @./uninstall/docker +# Uninstall lite-xl +/lite-xl: + @./uninstall/lite-xl + # Uninstall omz /omz: @./uninstall/omz diff --git a/install/composer-clean b/install/composer-clean index ff3bf3c..b034639 100755 --- a/install/composer-clean +++ b/install/composer-clean @@ -12,7 +12,7 @@ installed() { command -v "$1" >/dev/null 2>&1 } -!installed "php" && echo "WARNING: You need to have php installed" +! installed "php" && echo "WARNING: You need php to be installed" if installed "composer"; then echo "WARNING: Removing current composer to install its actual version" diff --git a/install/php-tools-only b/install/php-tools-only new file mode 100755 index 0000000..9cf7bff --- /dev/null +++ b/install/php-tools-only @@ -0,0 +1,41 @@ +#!/bin/bash +##makedesc: Install phpunit + psalm + phpcs + php-cs-fixer + +echo +echo "===============================================" +echo "Installing phpunit + psalm + phpcs + php-cs-fixer..." +echo "===============================================" +echo + +installed() { + command -v "$1" >/dev/null 2>&1 +} + +! installed "php" && echo "ERROR: You need php to be installed" && exit 1 +! installed "composer" && echo "ERROR: You need composer to be installed" && exit 2 + +composer global require phpunit/phpunit --dev +composer global require phpmd/phpmd --dev +composer global require squizlabs/php_codesniffer --dev +composer global require friendsofphp/php-cs-fixer --dev +composer global require vimeo/psalm --dev +composer global require phpstan/phpstan --dev +# composer global require phpunit/dbunit +# composer global require phing/phing +# composer global require phpdocumentor/phpdocumentor +# composer global require sebastian/phpcpd +# composer global require phploc/phploc + +export PATH="$(composer config -g home)/vendor/bin:${PATH}" +echo 'export PATH="$(composer config -g home)/vendor/bin:${PATH}"' >> "${HOME}/.profile" + +phpunit --version +phpmd --version +phpcs --version # phpcbf --version +php-cs-fixer --version +psalm --version +phpstan --version + +echo +echo "Finish!" +echo diff --git a/packs/phptools b/packs/phptools new file mode 100644 index 0000000..01cdfde --- /dev/null +++ b/packs/phptools @@ -0,0 +1,2 @@ +# [PACK] php + composer + phpunit + psalm + phpcs + php-cs-fixer +phptools: php composer-clean php-tools-only