Skip to content

Commit 3087432

Browse files
feat: folders for varients
1 parent 9e91a90 commit 3087432

File tree

7 files changed

+11
-10
lines changed

7 files changed

+11
-10
lines changed

build.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,19 @@ msg() { echo -e "${*} \e[0m" >&2;:;}
3333
# DEFAULTS
3434
ARCH="all"
3535
VARIENT="raw"
36+
UD_ROOT_DIR=$(git rev-parse --show-toplevel)
3637

3738
function build() {
3839
# load suites
39-
_avalible_suites="$(find ./suites -type d ! -name '*-*' | cut -d / -f 3 | awk 'NF' | uniq -u | tr '\n' ' ')"
40+
_avalible_suites="$(find ./suites -maxdepth 1 -type d ! -name '*-*' | cut -d / -f 3 | awk 'NF' | uniq -u | tr '\n' ' ')"
4041

4142
# check is SUITE avalible in ./suites
4243
if [[ ! ${_avalible_suites} =~ $SUITE ]]; then
4344
die "$SUITE not found in ./suites"
4445
fi
4546

4647
# load avalible varients
47-
_avalible_varients=$(find ./suites/"$SUITE" -type f | cut -d / -f 4 | awk 'NF')
48+
_avalible_varients=$(find ./suites/"$SUITE" -type d | cut -d / -f 4 | awk 'NF' | uniq -u | tr '\n' ' ')
4849

4950
# check is varient script avalible
5051
if [[ ! ${_avalible_varients} =~ $VARIENT ]]; then
@@ -56,19 +57,19 @@ function build() {
5657
msg "SUITE=$SUITE"
5758
msg "Varient=$VARIENT"
5859
msg "ARCH=$ARCH"
59-
cd fs-cook || die "failed to cd ./fs-cook" # script need to executed from fs-cook root directory
6060

61-
# pre-exe task
62-
# copy everything in name $VARIENT-* to fs-cook
63-
cp -r ../suites/"$SUITE"/"$VARIENT"-* ./
64-
bash ../suites/"$SUITE"/"$VARIENT".sh "$ARCH"
61+
cp -r ./suites/$SUITE/$VARIENT/$VARIENT* fs-cook
62+
cd fs-cook || die "Failed to cd.."
63+
bash $VARIENT.sh $ARCH || die "build script failed"
64+
cd $UD_ROOT_DIR || die "Failed fto cd "
65+
rm -rf fs-cook/$VARIENT*
6566
}
6667

6768
function _list() {
68-
for _suite in $(find ./suites -type d ! -name '*-*' | cut -d / -f 3 | awk 'NF' | uniq -u | tr '\n' ' '); do
69+
for _suite in $(find ./suites -maxdepth 1 -type d ! -name '*-*' | cut -d / -f 3 | awk 'NF' | uniq -u | tr '\n' ' '); do
6970
echo "[SUITE] $_suite"
70-
for _varient in $(find ./suites/"$_suite" -type f ! -name '*-*' | cut -d / -f 4 | awk 'NF'); do
71-
echo -e "\t -$_varient" | cut -d . -f 1
71+
for _varient in $(find ./suites/"$_suite" -type d ! -name '*-*' | cut -d / -f 4 | awk 'NF' | uniq -u | tr '\n' ' '); do
72+
echo -e "\t -$_varient"
7273
done
7374
done
7475
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)