diff --git a/containers/ddev-webserver/ddev-webserver-base-files/etc/bash.bashrc b/containers/ddev-webserver/ddev-webserver-base-files/etc/bash.bashrc index e8fd5a8c45f..cebb05779bc 100644 --- a/containers/ddev-webserver/ddev-webserver-base-files/etc/bash.bashrc +++ b/containers/ddev-webserver/ddev-webserver-base-files/etc/bash.bashrc @@ -6,7 +6,15 @@ # If not running interactively, don't do anything [ -z "$PS1" ] && return -export PATH="${DDEV_COMPOSER_ROOT:-/var/www/html}/vendor/bin:${PATH}" +# Add ${DDEV_COMPOSER_ROOT:-/var/www/html}/vendor/bin as the first item to the $PATH. +case ":$PATH:" in + # If the item is already in $PATH, don't add it again. + *":${DDEV_COMPOSER_ROOT:-/var/www/html}/vendor/bin:"*) ;; + # Otherwise, add it. + *) PATH="${DDEV_COMPOSER_ROOT:-/var/www/html}/vendor/bin:$PATH" ;; +esac +# And don't forget to export the new $PATH. +export PATH # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. diff --git a/containers/ddev-webserver/ddev-webserver-base-files/etc/bash.nointeractive.bashrc b/containers/ddev-webserver/ddev-webserver-base-files/etc/bash.nointeractive.bashrc index 3957f4e3aba..3731c9fd89c 100644 --- a/containers/ddev-webserver/ddev-webserver-base-files/etc/bash.nointeractive.bashrc +++ b/containers/ddev-webserver/ddev-webserver-base-files/etc/bash.nointeractive.bashrc @@ -1,7 +1,17 @@ # This file is loaded in non-interactive bash shells through $BASH_ENV -export PATH="${DDEV_COMPOSER_ROOT:-/var/www/html}/vendor/bin:${PATH}" + +# Add ${DDEV_COMPOSER_ROOT:-/var/www/html}/vendor/bin as the first item to the $PATH. +case ":$PATH:" in + # If the item is already in $PATH, don't add it again. + *":${DDEV_COMPOSER_ROOT:-/var/www/html}/vendor/bin:"*) ;; + # Otherwise, add it. + *) PATH="${DDEV_COMPOSER_ROOT:-/var/www/html}/vendor/bin:$PATH" ;; +esac +# And don't forget to export the new $PATH. +export PATH + for f in /etc/bashrc/*.bashrc; do - source $f; + source $f; done unset f diff --git a/containers/ddev-webserver/ddev-webserver-base-files/etc/bashrc/commandline-addons.bashrc b/containers/ddev-webserver/ddev-webserver-base-files/etc/bashrc/commandline-addons.bashrc index 2f6ac96cbbc..d8e9ed8a500 100644 --- a/containers/ddev-webserver/ddev-webserver-base-files/etc/bashrc/commandline-addons.bashrc +++ b/containers/ddev-webserver/ddev-webserver-base-files/etc/bashrc/commandline-addons.bashrc @@ -1,4 +1,19 @@ -export PATH="~/bin:$PATH:/var/www/html/bin" +# Add $HOME/bin as the first item to the $PATH. +case ":$PATH:" in + # If the item is already in $PATH, don't add it again. + *":$HOME/bin:"*) ;; + # Otherwise, add it. + *) PATH="$HOME/bin:$PATH" ;; +esac +# Add /var/www/html/bin as the last item to the $PATH. +case ":$PATH:" in + # If the item is already in $PATH, don't add it again. + *":/var/www/html/bin:"*) ;; + # Otherwise, add it. + *) PATH="$PATH:/var/www/html/bin" ;; +esac +# And don't forget to export the new $PATH. +export PATH [ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/bash_completion" ] && source "$NVM_DIR/bash_completion" diff --git a/pkg/versionconstants/versionconstants.go b/pkg/versionconstants/versionconstants.go index 912367d4740..504289f234a 100644 --- a/pkg/versionconstants/versionconstants.go +++ b/pkg/versionconstants/versionconstants.go @@ -11,7 +11,7 @@ var AmplitudeAPIKey = "" var WebImg = "ddev/ddev-webserver" // WebTag defines the default web image tag -var WebTag = "20241105_less_php_versions" // Note that this can be overridden by make +var WebTag = "20241105_stasadev_composer_bin" // Note that this can be overridden by make // DBImg defines the default db image used for applications. var DBImg = "ddev/ddev-dbserver"