Skip to content

Commit 075ffc0

Browse files
author
Greg Bowler
committed
Feedback when switching versions
1 parent 2bb2b99 commit 075ffc0

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Diff for: switch-phpunit-version

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
#!/bin/bash
2+
set -e
3+
24
if [ "$1" = "latest" ]
35
then
46
version=9
57
else
68
version=$1
79
fi
810

9-
rm -f /usr/local/bin/phpunit
10-
ln -s "/usr/local/bin/phpunit-$version" "/usr/local/bin/phpunit"
11+
phpunit_bin="/usr/local/bin/phpunit-$version"
12+
13+
if test -f $phpunit_bin
14+
then
15+
rm -f /usr/local/bin/phpunit
16+
ln -s "$phpunit_bin" "/usr/local/bin/phpunit"
17+
echo "Successfully linked $phpunit_bin"
18+
else
19+
echo "Error linking $phpunit_bin: version doesn't exit"
20+
exit 1
21+
fi

0 commit comments

Comments
 (0)