Skip to content

Commit ff33ded

Browse files
committed
refactor: Binaries directory
1 parent 8c9d906 commit ff33ded

File tree

10 files changed

+24
-24
lines changed

10 files changed

+24
-24
lines changed

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ test:
44

55
.PHONY: install
66
install:
7-
@sudo ln -sf $(shell pwd)/composer /usr/local/bin/composer
8-
@sudo ln -sf $(shell pwd)/php /usr/local/bin/php
9-
@sudo ln -sf $(shell pwd)/phpctl /usr/local/bin/pctl
10-
@sudo ln -sf $(shell pwd)/phpctl /usr/local/bin/phpctl
11-
@sudo ln -sf $(shell pwd)/phpunit /usr/local/bin/phpunit
7+
@sudo ln -sf $(shell pwd)/bin/composer /usr/local/bin/composer
8+
@sudo ln -sf $(shell pwd)/bin/php /usr/local/bin/php
9+
@sudo ln -sf $(shell pwd)/bin/phpctl /usr/local/bin/pctl
10+
@sudo ln -sf $(shell pwd)/bin/phpctl /usr/local/bin/phpctl
11+
@sudo ln -sf $(shell pwd)/bin/phpunit /usr/local/bin/phpunit

composer renamed to bin/composer

File renamed without changes.

php renamed to bin/php

File renamed without changes.

phpctl renamed to bin/phpctl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
PHPCTL_DIR=$(dirname "$(realpath "$0")")
2+
PHPCTL_DIR=$(dirname "$(realpath "$0")")/../
33
if [ -s .phpctlrc ]; then
44
set -a
55
. .phpctlrc

phpunit renamed to bin/phpunit

File renamed without changes.

installer.sh

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
INSTALL_DIR=~/.phpctl
44

55
symlink() {
6-
sudo ln -sf "${INSTALL_DIR}/composer" /usr/local/bin/composer
7-
sudo ln -sf "${INSTALL_DIR}/php" /usr/local/bin/php
8-
sudo ln -sf "${INSTALL_DIR}/phpctl" /usr/local/bin/pctl
9-
sudo ln -sf "${INSTALL_DIR}/phpctl" /usr/local/bin/phpctl
10-
sudo ln -sf "${INSTALL_DIR}/phpunit" /usr/local/bin/phpunit
6+
sudo ln -sf "${INSTALL_DIR}/bin/composer" /usr/local/bin/composer
7+
sudo ln -sf "${INSTALL_DIR}/bin/php" /usr/local/bin/php
8+
sudo ln -sf "${INSTALL_DIR}/bin/phpctl" /usr/local/bin/pctl
9+
sudo ln -sf "${INSTALL_DIR}/bin/phpctl" /usr/local/bin/phpctl
10+
sudo ln -sf "${INSTALL_DIR}/bin/phpunit" /usr/local/bin/phpunit
1111
}
1212

1313
echo "\033[0;33mInstalling phpctl at \033[0m$INSTALL_DIR"
@@ -21,10 +21,10 @@ if [ "$answer" != "${answer#[Yy]}" ]; then
2121
else
2222
echo "\033[0;31mTo use phpclt globally, link the cloned script to your bin directory, like:\033[0m"
2323
echo ""
24-
echo " sudo ln -sf ${INSTALL_DIR}/composer /usr/local/bin/composer"
25-
echo " sudo ln -sf ${INSTALL_DIR}/php /usr/local/bin/php"
26-
echo " sudo ln -sf ${INSTALL_DIR}/phpctl /usr/local/bin/pctl"
27-
echo " sudo ln -sf ${INSTALL_DIR}/phpctl /usr/local/bin/phpctl"
28-
echo " sudo ln -sf ${INSTALL_DIR}/phpunit /usr/local/bin/phpunit"
24+
echo " sudo ln -sf ${INSTALL_DIR}/bin/composer /usr/local/bin/composer"
25+
echo " sudo ln -sf ${INSTALL_DIR}/bin/php /usr/local/bin/php"
26+
echo " sudo ln -sf ${INSTALL_DIR}/bin/phpctl /usr/local/bin/pctl"
27+
echo " sudo ln -sf ${INSTALL_DIR}/bin/phpctl /usr/local/bin/phpctl"
28+
echo " sudo ln -sf ${INSTALL_DIR}/bin/phpunit /usr/local/bin/phpunit"
2929
echo ""
3030
fi

tests/doctor_test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
function test_doctor() {
2-
assert_contains "PHPCTL_IMAGE=" "$(./phpctl doctor)"
2+
assert_contains "PHPCTL_IMAGE=" "$(./bin/phpctl doctor)"
33
}

tests/help_test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
function test_help_is_default() {
2-
assert_contains "phpctl <command> [arguments]" "$(./phpctl)"
2+
assert_contains "phpctl <command> [arguments]" "$(./bin/phpctl)"
33
}

tests/php_test.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
function test_php_version_is_default() {
2-
assert_contains "Copyright (c) The PHP Group" "$(./phpctl php)"
2+
assert_contains "Copyright (c) The PHP Group" "$(./bin/phpctl php)"
33
}
44

55
function test_php_accepts_arguments() {
6-
assert_contains "[PHP Modules]" "$(./phpctl php -m)"
7-
assert_contains "Configuration File (php.ini) " "$(./phpctl php --ini)"
6+
assert_contains "[PHP Modules]" "$(./bin/phpctl php -m)"
7+
assert_contains "Configuration File (php.ini) " "$(./bin/phpctl php --ini)"
88
}
99

1010
function test_composer() {
11-
assert_contains "version" "$(./phpctl composer --version)"
11+
assert_contains "version" "$(./bin/phpctl composer --version)"
1212
}

tests/sh_test.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
function test_sh_commands() {
2-
assert_contains "/opt" "$(./phpctl sh pwd)"
3-
assert_contains "test" "$(./phpctl sh echo test)"
2+
assert_contains "/opt" "$(./bin/phpctl sh pwd)"
3+
assert_contains "test" "$(./bin/phpctl sh echo test)"
44
}

0 commit comments

Comments
 (0)