Fix if check

This commit is contained in:
Anthony Rose 2022-07-18 10:37:09 +01:00
parent a1f24b895b
commit 5c9dc85e01

View file

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
if [ x$1 == x ]; then if [ x$1 != x ]; then
install_path=$1 install_path=$1
if [ $(id -u) -eq 0 ]; then if [ $(id -u) -eq 0 ]; then
bin_path=/usr/local/bin bin_path=/usr/local/bin
@ -28,6 +28,8 @@ else
install_path="$HOME/opt/ansible" install_path="$HOME/opt/ansible"
bin_path="$HOME/.local/bin" bin_path="$HOME/.local/bin"
fi fi
echo "Install path: $install_path"
echo "Bin path: $bin_path"
pipinstall () { pipinstall () {
./bin/pip install --upgrade $1 ./bin/pip install --upgrade $1
@ -42,7 +44,7 @@ if [ ! -x "$py3cmd" ]; then
echo "python3 not found" echo "python3 not found"
exit 1 exit 1
else else
echo "python3 found: $py3cmd" echo "Python3 found: $py3cmd"
fi fi
if ! $($py3cmd -c "import venv" 2> /dev/null); then if ! $($py3cmd -c "import venv" 2> /dev/null); then