Skip to content

Commit 197baf6

Browse files
author
Greg Bowler
committed
Check for yaml mistake
1 parent 11242c0 commit 197baf6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

switch-php-version

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ else
88
version="$1"
99
fi
1010

11+
# If there is no decimal, let's add one back. This is probably thanks to the
12+
# devilish ways of Yaml. php_version: 8.0 is kindly converted to php_version: 8
13+
# Thanks, Yaml!
14+
if [[ $version != *"."* ]]; then
15+
version="$version.0"
16+
fi
17+
1118
php_bin="/etc/php/$version/bin/php"
1219

1320
if test -f $php_bin

0 commit comments

Comments
 (0)