mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Remove bashisms, replace with POSIX constructs
This replaces double conditional brackets with single ones and gets ris of bashisms, so that the tool should be sourcable from any POSIX shell. Constructs like [ $foo = "$bar"* ] yield filesystem-globbing behaviour according to POSIX. A compliant way is to use case statements. Signed-off-by: martin f. krafft <madduck@madduck.net>
This commit is contained in:
parent
9f4988dbfd
commit
bbbc214ffb
1 changed files with 13 additions and 4 deletions
|
@ -20,14 +20,23 @@ PREFIX_PYTHONPATH="$ANSIBLE_HOME/lib"
|
|||
PREFIX_PATH="$ANSIBLE_HOME/bin"
|
||||
PREFIX_MANPATH="$ANSIBLE_HOME/docs/man"
|
||||
|
||||
[[ "$PYTHONPATH" != "${PREFIX_PYTHONPATH}"* ]] && export PYTHONPATH=$"PREFIX_PYTHONPATH:$PYTHONPATH"
|
||||
[[ "$PATH" != "${PREFIX_PATH}"* ]] && export PATH="$PREFIX_PATH:$PATH"
|
||||
case "$PYTHONPATH" in
|
||||
(*${PREFIX_PYTHONPATH}*) :;;
|
||||
(*) export PYTHONPATH=$"$PREFIX_PYTHONPATH${PYTHONPATH:+:$PYTHONPATH}";;
|
||||
esac
|
||||
case "$MANPATH" in
|
||||
(*${PREFIX_MANPATH}*) :;;
|
||||
(*) export MANPATH=$"$PREFIX_MANPATH${MANPATH:+:$MANPATH}";;
|
||||
esac
|
||||
case "$PATH" in
|
||||
(*${PREFIX_PATH}*) :;;
|
||||
(*) export PATH=$"$PREFIX_PATH${PATH:+:$PATH}";;
|
||||
esac
|
||||
export ANSIBLE_LIBRARY="$ANSIBLE_HOME/library"
|
||||
[[ "$MANPATH" != "${PREFIX_MANPATH}"* ]] && export MANPATH="$PREFIX_MANPATH:$MANPATH"
|
||||
|
||||
# Print out values unless -q is set
|
||||
|
||||
if [ $# -eq 0 -o "$1" != "-q" ] ; then
|
||||
if [ $# -eq 0 ] || [ "$1" != "-q" ] ; then
|
||||
echo ""
|
||||
echo "Setting up Ansible to run out of checkout..."
|
||||
echo ""
|
||||
|
|
Loading…
Reference in a new issue