Skip to content

Commit b70e819

Browse files
committed
feat: Add gen.sh script for building and executing profiles
1 parent 85af0db commit b70e819

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

alteriso/gen.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
set -Eeuo pipefail
4+
5+
# Determine script path
6+
script_path=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
7+
profile_dir="${1-"${script_path}/configs/xfce"}"
8+
if [[ -n "${1-""}" ]]; then
9+
shift 1
10+
fi
11+
12+
# Build the Go binary
13+
binfile="$(mktemp -u)"
14+
go build -o "$binfile" "$script_path/src"
15+
16+
17+
# Execute the build command
18+
"$binfile" profile \
19+
--bootloaders "$script_path/bootloaders/" \
20+
--modules "$script_path/modules/" \
21+
generate \
22+
--out "$script_path/out/$(basename "$profile_dir")" \
23+
"$profile_dir" "$@"
24+
25+
# Clean up
26+
rm "$binfile"

0 commit comments

Comments
 (0)