File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,25 +31,8 @@ if [ ! -f "dist/$bin" ]; then
3131 exit 1
3232fi
3333
34- if [ -z " ${FRANKENPHP_VERSION} " ]; then
35- FRANKENPHP_VERSION=" $( git rev-parse --verify HEAD) "
36- export FRANKENPHP_VERSION
37- elif [ -d " .git/" ]; then
38- CURRENT_REF=" $( git rev-parse --abbrev-ref HEAD) "
39- export CURRENT_REF
40-
41- if echo " ${FRANKENPHP_VERSION} " | grep -F -q " ." ; then
42- # Tag
43-
44- # Trim "v" prefix if any
45- FRANKENPHP_VERSION=${FRANKENPHP_VERSION# v}
46- export FRANKENPHP_VERSION
47-
48- git checkout " v${FRANKENPHP_VERSION} "
49- else
50- git checkout " ${FRANKENPHP_VERSION} "
51- fi
52- fi
34+ version_output=" $( dist/" $bin " version) "
35+ FRANKENPHP_VERSION=$( echo " $version_output " | grep -oP ' FrankenPHP\s+\K[0-9]+\.[0-9]+\.[0-9]+' || true)
5336
5437if [[ ! " ${FRANKENPHP_VERSION} " =~ ^[0-9]+\. [0-9]+\. [0-9]+$ ]]; then
5538 echo " Warning: FRANKENPHP_VERSION must be set to X.Y.Z (e.g. 1.5.1), got '${FRANKENPHP_VERSION} '"
You can’t perform that action at this time.
0 commit comments