Skip to content

Commit

Permalink
Merge 925fef4 into 5ec78e0
Browse files Browse the repository at this point in the history
  • Loading branch information
gucchisk committed Feb 11, 2020
2 parents 5ec78e0 + 925fef4 commit 86aa4be
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions shell/phpbrew.fish
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ function __phpbrew_php_exec

# Check if we are in a PHPBrew source directory (this is only for development)
if [ -e bin/phpbrew ]
set -a cmd bin/phpbrew
set cmd $cmd bin/phpbrew
else
set -a cmd (__phpbrew_which phpbrew)
set cmd $cmd (__phpbrew_which phpbrew)
end

command $cmd $argv
eval $cmd $argv
end

# Normalizes a PHP build by adding the "php-" prefix if it's missing
Expand Down Expand Up @@ -125,7 +125,7 @@ function __phpbrew_validate_interpreter
return 1
end

set PHP_VERSION_ID (command $argv[1] -r "echo PHP_VERSION_ID;")
set PHP_VERSION_ID (eval $argv[1] -r "\"echo PHP_VERSION_ID;\"")
or return 1

if [ $PHP_VERSION_ID -lt $MIN_PHP_VERSION_ID ]
Expand Down Expand Up @@ -181,7 +181,7 @@ function __phpbrew_edit_ini
set -q EDITOR;
or set -l EDITOR nano

command $EDITOR $ini
eval $EDITOR $ini
end

function phpbrew
Expand All @@ -207,7 +207,7 @@ function phpbrew
end

set -l IFS
if not set -l output (__phpbrew_php_exec env (__phpbrew_normalize_build $argv[2]))
if not set output (__phpbrew_php_exec env (__phpbrew_normalize_build $argv[2]))
echo $output
return 1
end
Expand Down Expand Up @@ -259,7 +259,9 @@ function phpbrew
return 0

case each
__phpbrew_each $argv[2..-1]
if [ (count $argv) -gt 1 ]
__phpbrew_each $argv[2..-1]
end

case fpm
if [ (count $argv) -ge 3 ]
Expand Down Expand Up @@ -396,7 +398,7 @@ end

function __phpbrew_update_config
set -l IFS
if not set -l output (__phpbrew_php_exec env $argv)
if not set output (__phpbrew_php_exec env $argv)
echo $output
return 1
end
Expand All @@ -410,7 +412,7 @@ function __phpbrew_update_config
end

function __phpbrew_reinit
__phpbrew_update_config $argv && __phpbrew_set_path
__phpbrew_update_config $argv; and __phpbrew_set_path
end

function __phpbrew_each
Expand All @@ -423,7 +425,7 @@ function __phpbrew_each
for build in $PHPBREW_ROOT/php/*
if test -x $build/bin/php
phpbrew use (basename $build)
eval $argv || set result $status
eval $argv; or set result $status
end
end;

Expand Down Expand Up @@ -556,7 +558,7 @@ function __fish_phpbrew_command
switch $token
case "-*"
case "*"
set -a command "$token"
set command $command "$token"
end
end

Expand All @@ -583,7 +585,7 @@ function __fish_phpbrew_using_command
case "--multiple"
set multiple yes
case "*"
set -a expected "$arg"
set expected $expected "$arg"
end
end

Expand Down

0 comments on commit 86aa4be

Please sign in to comment.