diff --git a/Makefile b/Makefile index 1b3cc88..ec644a2 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,8 @@ test: .PHONY: install install: - @sudo ln -sf $(shell pwd)/composer /usr/local/bin/composer - @sudo ln -sf $(shell pwd)/php /usr/local/bin/php - @sudo ln -sf $(shell pwd)/phpctl /usr/local/bin/pctl - @sudo ln -sf $(shell pwd)/phpctl /usr/local/bin/phpctl - @sudo ln -sf $(shell pwd)/phpunit /usr/local/bin/phpunit + @sudo ln -sf $(shell pwd)/bin/composer /usr/local/bin/composer + @sudo ln -sf $(shell pwd)/bin/php /usr/local/bin/php + @sudo ln -sf $(shell pwd)/bin/phpctl /usr/local/bin/pctl + @sudo ln -sf $(shell pwd)/bin/phpctl /usr/local/bin/phpctl + @sudo ln -sf $(shell pwd)/bin/phpunit /usr/local/bin/phpunit diff --git a/composer b/bin/composer similarity index 100% rename from composer rename to bin/composer diff --git a/php b/bin/php similarity index 100% rename from php rename to bin/php diff --git a/phpctl b/bin/phpctl similarity index 89% rename from phpctl rename to bin/phpctl index 8bd27f1..3b5bcbc 100755 --- a/phpctl +++ b/bin/phpctl @@ -1,5 +1,5 @@ #!/usr/bin/env bash -PHPCTL_DIR=$(dirname "$(realpath "$0")") +PHPCTL_DIR=$(dirname "$(realpath "$0")")/../ if [ -s .phpctlrc ]; then set -a . .phpctlrc diff --git a/phpunit b/bin/phpunit similarity index 100% rename from phpunit rename to bin/phpunit diff --git a/installer.sh b/installer.sh index 71e0a9a..91f9a87 100755 --- a/installer.sh +++ b/installer.sh @@ -3,11 +3,11 @@ INSTALL_DIR=~/.phpctl symlink() { - sudo ln -sf "${INSTALL_DIR}/composer" /usr/local/bin/composer - sudo ln -sf "${INSTALL_DIR}/php" /usr/local/bin/php - sudo ln -sf "${INSTALL_DIR}/phpctl" /usr/local/bin/pctl - sudo ln -sf "${INSTALL_DIR}/phpctl" /usr/local/bin/phpctl - sudo ln -sf "${INSTALL_DIR}/phpunit" /usr/local/bin/phpunit + sudo ln -sf "${INSTALL_DIR}/bin/composer" /usr/local/bin/composer + sudo ln -sf "${INSTALL_DIR}/bin/php" /usr/local/bin/php + sudo ln -sf "${INSTALL_DIR}/bin/phpctl" /usr/local/bin/pctl + sudo ln -sf "${INSTALL_DIR}/bin/phpctl" /usr/local/bin/phpctl + sudo ln -sf "${INSTALL_DIR}/bin/phpunit" /usr/local/bin/phpunit } echo "\033[0;33mInstalling phpctl at \033[0m$INSTALL_DIR" @@ -21,10 +21,10 @@ if [ "$answer" != "${answer#[Yy]}" ]; then else echo "\033[0;31mTo use phpclt globally, link the cloned script to your bin directory, like:\033[0m" echo "" - echo " sudo ln -sf ${INSTALL_DIR}/composer /usr/local/bin/composer" - echo " sudo ln -sf ${INSTALL_DIR}/php /usr/local/bin/php" - echo " sudo ln -sf ${INSTALL_DIR}/phpctl /usr/local/bin/pctl" - echo " sudo ln -sf ${INSTALL_DIR}/phpctl /usr/local/bin/phpctl" - echo " sudo ln -sf ${INSTALL_DIR}/phpunit /usr/local/bin/phpunit" + echo " sudo ln -sf ${INSTALL_DIR}/bin/composer /usr/local/bin/composer" + echo " sudo ln -sf ${INSTALL_DIR}/bin/php /usr/local/bin/php" + echo " sudo ln -sf ${INSTALL_DIR}/bin/phpctl /usr/local/bin/pctl" + echo " sudo ln -sf ${INSTALL_DIR}/bin/phpctl /usr/local/bin/phpctl" + echo " sudo ln -sf ${INSTALL_DIR}/bin/phpunit /usr/local/bin/phpunit" echo "" fi diff --git a/tests/doctor_test.sh b/tests/doctor_test.sh index bb04e79..5a99a9c 100644 --- a/tests/doctor_test.sh +++ b/tests/doctor_test.sh @@ -1,3 +1,3 @@ function test_doctor() { - assert_contains "PHPCTL_IMAGE=" "$(./phpctl doctor)" + assert_contains "PHPCTL_IMAGE=" "$(./bin/phpctl doctor)" } diff --git a/tests/help_test.sh b/tests/help_test.sh index 4be374d..28264fb 100644 --- a/tests/help_test.sh +++ b/tests/help_test.sh @@ -1,3 +1,3 @@ function test_help_is_default() { - assert_contains "phpctl [arguments]" "$(./phpctl)" + assert_contains "phpctl [arguments]" "$(./bin/phpctl)" } diff --git a/tests/php_test.sh b/tests/php_test.sh index 2a803ad..ffa36a6 100644 --- a/tests/php_test.sh +++ b/tests/php_test.sh @@ -1,12 +1,12 @@ function test_php_version_is_default() { - assert_contains "Copyright (c) The PHP Group" "$(./phpctl php)" + assert_contains "Copyright (c) The PHP Group" "$(./bin/phpctl php)" } function test_php_accepts_arguments() { - assert_contains "[PHP Modules]" "$(./phpctl php -m)" - assert_contains "Configuration File (php.ini) " "$(./phpctl php --ini)" + assert_contains "[PHP Modules]" "$(./bin/phpctl php -m)" + assert_contains "Configuration File (php.ini) " "$(./bin/phpctl php --ini)" } function test_composer() { - assert_contains "version" "$(./phpctl composer --version)" + assert_contains "version" "$(./bin/phpctl composer --version)" } diff --git a/tests/sh_test.sh b/tests/sh_test.sh index 2bfe660..44e012e 100644 --- a/tests/sh_test.sh +++ b/tests/sh_test.sh @@ -1,4 +1,4 @@ function test_sh_commands() { - assert_contains "/opt" "$(./phpctl sh pwd)" - assert_contains "test" "$(./phpctl sh echo test)" + assert_contains "/opt" "$(./bin/phpctl sh pwd)" + assert_contains "test" "$(./bin/phpctl sh echo test)" }