mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 23:12:08 -03:30
Tell Makefile and pre-commit.sh that they are bash
On some systems, /bin/sh is a bash symlink and running it will launch bash in sh compatibility mode. However, bash-specific syntax will still work in this mode (for example using == or pipefail). However, on systems where /bin/sh is a symlink to another shell (think: Debian-based) they might not have those bashisms. Set the shell in the Makefile, so that it uses bash (since it is already depending on bash, even though it is calling it as /bin/sh by default), and add a shebang to pre-commit.sh for the same reason. Signed-off-by: Rick Elrod <rick@elrod.me>
This commit is contained in:
parent
8cfb704f86
commit
b8ba2feecd
1
Makefile
1
Makefile
@ -1,6 +1,7 @@
|
|||||||
-include awx/ui_next/Makefile
|
-include awx/ui_next/Makefile
|
||||||
|
|
||||||
PYTHON := $(notdir $(shell for i in python3.9 python3; do command -v $$i; done|sed 1q))
|
PYTHON := $(notdir $(shell for i in python3.9 python3; do command -v $$i; done|sed 1q))
|
||||||
|
SHELL := bash
|
||||||
DOCKER_COMPOSE ?= docker-compose
|
DOCKER_COMPOSE ?= docker-compose
|
||||||
OFFICIAL ?= no
|
OFFICIAL ?= no
|
||||||
NODE ?= node
|
NODE ?= node
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
if [ -z $AWX_IGNORE_BLACK ] ; then
|
if [ -z $AWX_IGNORE_BLACK ] ; then
|
||||||
python_files_changed=$(git diff --cached --name-only --diff-filter=AM | grep -E '\.py$')
|
python_files_changed=$(git diff --cached --name-only --diff-filter=AM | grep -E '\.py$')
|
||||||
if [ "x$python_files_changed" != "x" ] ; then
|
if [ "x$python_files_changed" != "x" ] ; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user