Skip to content

Commit

Permalink
fix: expand ~/bin in PATH and ensure consistency in subshells, for d…
Browse files Browse the repository at this point in the history
  • Loading branch information
stasadev authored Nov 8, 2024
1 parent 8f61e7f commit 62bf39b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/versionconstants/versionconstants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 62bf39b

Please sign in to comment.