travis2bash.sh configuragble config file

- passing an argument to travis2bash.sh allows to use a custom config
  file instead of the default .travis.yml
This commit is contained in:
Peter Šurda 2021-03-30 21:18:49 +02:00
parent 4430940d5e
commit 0377ebff81
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -6,6 +6,7 @@
# Based on https://gist.github.com/pkuczynski/8665367 # Based on https://gist.github.com/pkuczynski/8665367
failure=0 failure=0
config_file=.travis.yml
parse_yaml() { parse_yaml() {
local yaml_file=$1 local yaml_file=$1
@ -56,8 +57,12 @@ create_variables() {
eval "$(parse_yaml "$yaml_file" "$prefix")" eval "$(parse_yaml "$yaml_file" "$prefix")"
} }
if [ ! -e .travis.yml ]; then if [ -n "$1" ]; then
echo "No .travis.yml found, exiting" config_file="$1"
fi
if [ ! -e "$config_file" ]; then
echo "No $config_file found, exiting"
exit 1 exit 1
fi fi
@ -150,7 +155,7 @@ function python_run() {
fi fi
} }
create_variables .travis.yml travis_ create_variables "$config_file" travis_
rundir=$(pwd) rundir=$(pwd)