File tree 1 file changed +9
-9
lines changed
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- basedir=" ` dirname " $0 " ` /../"
3
- cd " $basedir "
4
- basedir=` pwd`
2
+ basedir=" $( dirname " $0 " ) /../"
3
+ cd " $basedir " || exit
4
+ basedir=" $( pwd) "
5
5
binlink=" $basedir /current"
6
- active=` basename $( readlink " $binlink " ) 2> /dev/null | sed -e ' s/^php-//;s/\./\\\\./g' `
6
+ active=` basename " $( readlink " $binlink " ) " 2> /dev/null | sed -e ' s/^php-//;s/\./\\\\./g' `
7
7
8
8
php_system=" "
9
9
if [ -f " /usr/bin/php" ]; then
23
23
version=" $1 "
24
24
phpdir=" php-$version "
25
25
26
- if [ $version != " $php_system " ]; then
26
+ if [ " $version " != " $php_system " ]; then
27
27
if [ ! -d " $basedir /$phpdir " ]; then
28
28
echo " PHP version $version is not installed"
29
29
exit 2
30
30
else
31
- echo Setting active PHP version to $version
31
+ echo " Setting active PHP version to $version "
32
32
ln -sfT " $phpdir " " $binlink "
33
- $basedir /current/bin/php --version
33
+ " $basedir /current/bin/php" --version
34
34
fi
35
- else
35
+ else
36
36
echo " Setting active PHP version to system version ($version )"
37
37
rm -f " $binlink "
38
38
php --version
39
- fi
39
+ fi
You can’t perform that action at this time.
0 commit comments