Skip to content

Commit 12fc223

Browse files
robsonpeixotopearofducks
authored andcommitted
Enable Ultisnip generation using Homebrew-installed Ansible
1 parent 42accac commit 12fc223

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ Use your favorite plugin manager, or try [vim-plug](https://github.com/junegunn/
3939
**vim-plug:** `Plug 'pearofducks/ansible-vim'`
4040

4141
**vim-plug with post-update hook:** `Plug 'pearofducks/ansible-vim', { 'do':
42-
'cd ./UltiSnips; ./generate.py' }`
42+
'./UltiSnips/generate.sh' }`
4343

44-
*Note: `generate.py` requires Ansible 2.4 or later.*
44+
*Note: `generate.sh` requires Ansible 2.4 or later.*
4545

4646
**vundle:** `Plugin 'pearofducks/ansible-vim'`
4747

UltiSnips/generate.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
IFS=$'\n\t'
4+
5+
cd "$(dirname "$0")"
6+
7+
ANSIBLE_MODULE_LOCATION="$(ansible --version | grep "ansible python module location" | sed -E 's/ +ansible python module location += +//g')"
8+
PYTHONPATH="$(dirname "$ANSIBLE_MODULE_LOCATION")"
9+
PYTHON_VERSION=$(basename "$(dirname "$PYTHONPATH")")
10+
11+
export PYTHONPATH
12+
exec "$PYTHON_VERSION" generate.py

0 commit comments

Comments
 (0)