|
|
|
@ -3,9 +3,23 @@
|
|
|
|
# Description: Modifies the environment for running Ansible from a checkout
|
|
|
|
# Description: Modifies the environment for running Ansible from a checkout
|
|
|
|
# Usage: . ./hacking/env-setup [-q]
|
|
|
|
# Usage: . ./hacking/env-setup [-q]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Set PYTHON_BIN
|
|
|
|
|
|
|
|
if not set -q PYTHON_BIN
|
|
|
|
|
|
|
|
for exe in python3 python
|
|
|
|
|
|
|
|
if command -v $exe > /dev/null
|
|
|
|
|
|
|
|
set -gx PYTHON_BIN (command -v $exe)
|
|
|
|
|
|
|
|
break
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
if not set -q PYTHON_BIN
|
|
|
|
|
|
|
|
echo "No valid Python found"
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# Retrieve the path of the current directory where the script resides
|
|
|
|
# Retrieve the path of the current directory where the script resides
|
|
|
|
set HACKING_DIR (dirname (status -f))
|
|
|
|
set HACKING_DIR (dirname (status -f))
|
|
|
|
set FULL_PATH (python -c "import os; print(os.path.realpath('$HACKING_DIR'))")
|
|
|
|
set FULL_PATH ($PYTHON_BIN -c "import os; print(os.path.realpath('$HACKING_DIR'))")
|
|
|
|
set ANSIBLE_HOME (dirname $FULL_PATH)
|
|
|
|
set ANSIBLE_HOME (dirname $FULL_PATH)
|
|
|
|
|
|
|
|
|
|
|
|
# Set quiet flag
|
|
|
|
# Set quiet flag
|
|
|
|
@ -50,20 +64,6 @@ else if not string match -qr $PREFIX_MANPATH'($|:)' $MANPATH
|
|
|
|
set -gx MANPATH "$PREFIX_MANPATH:$MANPATH"
|
|
|
|
set -gx MANPATH "$PREFIX_MANPATH:$MANPATH"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# Set PYTHON_BIN
|
|
|
|
|
|
|
|
if not set -q PYTHON_BIN
|
|
|
|
|
|
|
|
for exe in python3 python
|
|
|
|
|
|
|
|
if command -v $exe > /dev/null
|
|
|
|
|
|
|
|
set -gx PYTHON_BIN (command -v $exe)
|
|
|
|
|
|
|
|
break
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
if not set -q PYTHON_BIN
|
|
|
|
|
|
|
|
echo "No valid Python found"
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pushd $ANSIBLE_HOME
|
|
|
|
pushd $ANSIBLE_HOME
|
|
|
|
if test -n "$QUIET"
|
|
|
|
if test -n "$QUIET"
|
|
|
|
# Remove any .pyc files found
|
|
|
|
# Remove any .pyc files found
|
|
|
|
|