install.fairie/dotfiles/.vim/plugged/ansible-vim/UltiSnips/generate.sh

13 lines
376 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"
ANSIBLE_MODULE_LOCATION="$(ansible --version | grep "ansible python module location" | sed -E 's/ +ansible python module location += +//g')"
PYTHONPATH="$(dirname "$ANSIBLE_MODULE_LOCATION")"
PYTHON_VERSION=$(basename "$(dirname "$PYTHONPATH")")
export PYTHONPATH
exec "$PYTHON_VERSION" generate.py $@