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 untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87
1 changed files with 8 additions and 3 deletions

View File

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