24 lines
403 B
Bash
Executable File
24 lines
403 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
TEMPLATE_DIR="./templates/"
|
|
OUT_DIR="./out/"
|
|
ENV_FILE="./vars.env"
|
|
|
|
mkdir -p "$TEMPLATE_DIR"
|
|
|
|
cd "$TEMPLATE_DIR"
|
|
template_files=$(find -type f)
|
|
cd - > /dev/null
|
|
|
|
for file in $template_files
|
|
do
|
|
out_path=$(realpath -m "$OUT_DIR$file")
|
|
mkdir -p $(dirname "$out_path")
|
|
|
|
./fill-template.pl -env="$ENV_FILE" "$TEMPLATE_DIR$file" > $out_path
|
|
done
|