Skip to content

Commit

Permalink
extend functionality of cmake-check-yaml to override default example …
Browse files Browse the repository at this point in the history
…directory
  • Loading branch information
dirkzerwas committed Sep 26, 2024
1 parent 08e84a6 commit 41bc79b
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions test/cmake-check-yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@ set -e
shopt -s expand_aliases
source ../setup.sh

EXAMPLEDIR="${PWD}/../examples"

OPTSTRING="d:h"
while getopts ${OPTSTRING} opt; do
case ${opt} in
d)
echo "Option -g was triggered, Argument: ${OPTARG}"
EXAMPLEDIR="${OPTARG}"
echo $EXAMPLEDIR is searched for
;;
h)
echo "Arguments are:"
echo "-h for help"
echo "-d YAMLDIRECTORY "
exit 0
;;
?)
echo "Invalid option: -${OPTARG}."
exit 1
;;
esac
done

CWD=${PWD}
# only create the directory if it does not exist yet
if [[ ! -d ${CWD}/ci-setups ]]; then
Expand All @@ -13,10 +36,9 @@ else
rm -Rf ci-setups/*
fi

EXAMPLEDIR="${PWD}/../examples"

# only copy if the file does not exist yet:
for yamlFileWithPath in "$EXAMPLEDIR"/FermionProduction.*yaml; do
for yamlFileWithPath in "$EXAMPLEDIR"/*.yaml; do
yamlFile="$(basename "$yamlFileWithPath")"
echo checking for ci-setups/"$yamlFile"
if [[ ! -f ci-setups/"$yamlFile" ]]; then
Expand Down

0 comments on commit 41bc79b

Please sign in to comment.