Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow samples cache directory to be created if non-existent #239

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions build-tools/cache_samples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,27 @@ function cache_devfile() {
fi
}

devfileEntriesFile=$1
samplesDir=$2
if [[ "$OSTYPE" == "darwin"* ]]
then
if [[ $1 != ./* ]] && [[ $1 != ../* ]] && [[ $1 != /* ]]
then
devfileEntriesFile=./$1
else
devfileEntriesFile=$1
fi
if [[ $2 != ./* ]] && [[ $2 != ../* ]] && [[ $2 != /* ]]
michael-valdron marked this conversation as resolved.
Show resolved Hide resolved
then
samplesDir=./$2
else
samplesDir=$2
fi
else
devfileEntriesFile=$1
samplesDir=$2
fi

for sample in $(yq e '(.samples[].name)' $devfileEntriesFile); do
mkdir $samplesDir/$sample
mkdir -p $samplesDir/$sample
michael-valdron marked this conversation as resolved.
Show resolved Hide resolved
echo $sample
cache_sample $sample $samplesDir/$sample
done
Loading