about summary refs log tree commit diff
path: root/pkgs/build-support/php/hooks/php-script-utils.bash
diff options
context:
space:
mode:
authorPol Dellaiera <pol.dellaiera@protonmail.com>2024-02-19 10:14:19 +0100
committerPol Dellaiera <pol.dellaiera@protonmail.com>2024-02-25 10:03:22 +0100
commitf43fb4c110836bcbbbb5e6265f0d05293b819d7d (patch)
tree449cb2c83f9ba4d28b64a2f428c78f49b1fc26f5 /pkgs/build-support/php/hooks/php-script-utils.bash
parent2a34566b67bef34c551f204063faeecc444ae9da (diff)
build-support/php: set `COMPOSER_ROOT_VERSION` by default
Diffstat (limited to 'pkgs/build-support/php/hooks/php-script-utils.bash')
-rw-r--r--pkgs/build-support/php/hooks/php-script-utils.bash12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkgs/build-support/php/hooks/php-script-utils.bash b/pkgs/build-support/php/hooks/php-script-utils.bash
new file mode 100644
index 0000000000000..163d9306f5f4a
--- /dev/null
+++ b/pkgs/build-support/php/hooks/php-script-utils.bash
@@ -0,0 +1,12 @@
+declare version
+
+setComposeRootVersion() {
+    set +e # Disable exit on error
+
+    if [[ -v version ]]; then
+        echo -e "\e[32mSetting COMPOSER_ROOT_VERSION to $version\e[0m"
+        export COMPOSER_ROOT_VERSION=$version
+    fi
+
+    set -e
+}