Skip to content

Check existance of $HOME/bin before adding to PATH #5294

@bohni

Description

@bohni
  • I was not able to find an open or closed issue matching what I'm seeing

It's just an optimization for a *nix shell script. The behaviour is still present in current main branch.

https://github.com/git-for-windows/build-extra/blob/6735402549b1776f65723e129b9208fa0ee5056b/git-extra/env.sh#L2

export PATH="$HOME/bin:$PATH"

the PATH should only be extended, if the directory exists and is not already included in PATH

if [ -d ${HOME}/bin ]
then
  if [[ ! $PATH = *${HOME}/bin* ]]
  then
    export PATH="$HOME/bin:$PATH"
  fi
fi

Maybe the second test (that PATH already includes the directory) must be omitted because not every shell supports this check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Help Wantedhelp is requested from collaborators, please!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions