Skip to content

Commit

Permalink
fix: add docker exec tty to each command
Browse files Browse the repository at this point in the history
  • Loading branch information
coolcodemy committed Jul 31, 2021
1 parent 56c4217 commit 91a01a5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
/valet/composer.lock
/.valet-home
/www
/files
!/www/*
.DS_Store
24 changes: 15 additions & 9 deletions bin/butler
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ UNAMEOUT="$(uname -s)"
WHITE='\033[1;37m'
NC='\033[0m'

if [[ $NOTTY == "true" ]];then
TTY=""
else
TTY="t"
fi

# Function that outputs Butler is not running...
function butler_is_not_running {
echo -e "${WHITE}Butler is not running.${NC}" >&2
Expand Down Expand Up @@ -117,7 +123,7 @@ function valet_tld {
fi

# pass to valet
docker exec -i \
docker exec -i${TTY} \
-w $workdir \
butler_php_1 \
valet tld "$@"
Expand All @@ -142,7 +148,7 @@ function valet_secure {
CN=$1
fi

docker exec -i \
docker exec -i${TTY} \
-w $workdir \
butler_php_1 \
valet secure $CN
Expand All @@ -160,7 +166,7 @@ function valet_unsecure {
CN=$1
fi

docker exec -i \
docker exec -i${TTY} \
-w $workdir \
butler_php_1 \
valet unsecure $CN
Expand All @@ -175,7 +181,7 @@ function valet_proxy {

CN=$1

docker exec -i \
docker exec -i${TTY} \
butler_php_1 \
valet proxy "$@"

Expand All @@ -189,7 +195,7 @@ function valet_unproxy {

CN=$1

docker exec -i \
docker exec -i${TTY} \
-w $workdir \
butler_php_1 \
valet unproxy "$@"
Expand Down Expand Up @@ -292,7 +298,7 @@ elif [ "$1" == "restart" ];then
exit 0
elif [ "$1" == "reload" ];then
echo -e "${WHITE}Reload all butler related processes...${NC}" >&2
docker exec -i \
docker exec -i${TTY} \
butler_php_1 \
valet install
docker-compose -p butler up -d
Expand Down Expand Up @@ -338,12 +344,12 @@ if [[ "$1" == "php" || "$1" == "valet" || $1 == "composer" || $1 == "artisan" ]]
valet_trust "$@"
elif [[ $COMMAND == "artisan" || $command == "art" ]]; then
shift 1
docker exec -i \
docker exec -i${TTY} \
-w $workdir \
butler_php_1 \
php artisan "$@"
else
docker exec -i \
docker exec -i${TTY} \
-w $workdir \
butler_php_1 \
$COMMAND "$@"
Expand All @@ -365,7 +371,7 @@ elif [ "$1" == "trust" ];then
else
workdir=$(get_workdir)

docker exec -i \
docker exec -i${TTY} \
-w $workdir \
butler_php_1 \
valet "$@"
Expand Down

0 comments on commit 91a01a5

Please sign in to comment.