-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d08c9e5
commit 385083c
Showing
1 changed file
with
31 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,36 @@ | ||
#!/usr/bin/env bash | ||
#!/bin/bash | ||
|
||
DIRS="IN0009_GBS example" | ||
dirs=() | ||
|
||
function build() { | ||
mkdir -p build | ||
for dir in $DIRS; do | ||
mkdir -p build/$dir | ||
cd $dir | ||
echo "Building $dir" | ||
for subdir in ./*/; do | ||
|
||
shopt -s nullglob | ||
for deck in *.yaml; do | ||
if [ -f "$deck" ]; then | ||
echo "Building Deck $deck" | ||
ankitum $deck -l ../resources -o ../build/$dir/${deck%.yaml}.apkg | ||
fi | ||
done | ||
shopt -u nullglob | ||
# search all folders except "build" | ||
if [ -d "$subdir" ] && [ "$(basename "$subdir")" != "build" ]; then | ||
dirs+=("$subdir") | ||
fi | ||
done | ||
|
||
# Zip the generated decks | ||
zip ../build/$dir.zip ../build/$dir/*.apkg | ||
cd .. | ||
done | ||
} | ||
# create output folder | ||
mkdir -p build | ||
|
||
build | ||
# loop over directories | ||
for dir in "${dirs[@]}"; do | ||
mkdir -p build/$dir | ||
echo "Building $dir" | ||
( | ||
shopt -s nullglob | ||
for deck in "$dir"/*.yaml; do | ||
echo $deck | ||
if [ -f "./$deck" ]; then | ||
echo "Building Deck $dir/$deck" | ||
|
||
# make deck | ||
deckname=$(basename "$deck") | ||
ankitum "$deck" -l ./tum_logo.png -o ./build/$dir/"${deckname%.yaml}".apkg --debug | ||
fi | ||
done | ||
shopt -u nullglob | ||
|
||
zip ./build/$dir.zip ./build/$dir/*.apkg | ||
) | ||
done |