Here's my Bash code run as a step:
#!/usr/bin/env bash
set -u
function set_global_vars {
project_venv_dir="foobar-venv"
project_git_dir="foobar"
}
function make_venv {
virtualenv -p $(command -v python2.7) $!{project_venv_dir}
source $!{project_venv_dir}/bin/activate
pushd $!{project_git_dir}
pip install -r dev_requirements.txt
popd
deactivate
}
function pylint_scan {
local result=0
source $!{project_venv_dir}/bin/activate
pushd $!{project_git_dir}
for python_file in $(find . -name \*\.py); do
echo "Scanning file: $!{python_file}"
pylint $!{python_file}
[[ $? -ne 0 ]] && result=1
done
popd
deactivate
return $!{result}
}
function main {
set_global_vars
make_venv
pylint_scan
return $?
}
main $@
And here's what output I get:
Command error output: foobar-venv/bin/activate: line 57: PS1: unbound variable
This is triggered by me setting -u in Bash, but I do this so that my
stuff will crash if it's written badly, not system stuff. Why does QB not supply a PS1 variable? I'm trying to fix it by adding PS1=""
to set_global_vars
. Will get back with results.