mirror of https://github.com/ansible/ansible.git
Clean up shebangs for various files.
- Remove shebangs from: - ini files - unit tests - module_utils - plugins - module_docs_fragments - non-executable Makefiles - Change non-modules from '/usr/bin/python' to '/usr/bin/env python'. - Change '/bin/env' to '/usr/bin/env'. Also removed main functions from unit tests (since they no longer have a shebang) and fixed a python 3 compatibility issue with update_bundled.py so it does not need to specify a python 2 shebang. A script was added to check for unexpected shebangs in files. This script is run during CI on Shippable.pull/18327/head
parent
702ac436dc
commit
0d46805979
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
grep '^#!' -RIn . 2>/dev/null | grep ':1:' | sed 's/:1:/:/' | grep -v -E \
|
||||
-e '^\./lib/ansible/modules/' \
|
||||
-e '^\./test/integration/targets/[^/]*/library/[^/]*:#!powershell$' \
|
||||
-e ':#!/bin/sh$' \
|
||||
-e ':#!/bin/bash( -[eux]|$)' \
|
||||
-e ':#!/usr/bin/make -f$' \
|
||||
-e ':#!/usr/bin/env python$' \
|
||||
-e ':#!/usr/bin/env bash$' \
|
||||
-e ':#!/usr/bin/env fish$'
|
||||
|
||||
if [ $? -ne 1 ]; then
|
||||
echo "One or more file(s) listed above have an unexpected shebang."
|
||||
echo "See $0 for the list of acceptable values."
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in New Issue