-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake-comic.sh
More file actions
executable file
·41 lines (34 loc) · 1.2 KB
/
make-comic.sh
File metadata and controls
executable file
·41 lines (34 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# Makes a comic from a filled-in template folder.
# Usage: ./make-comic.sh <data-folder> [options]
#
# Examples:
# ./make-comic.sh ./my-comic
# ./make-comic.sh ./my-comic --validate # Dry run, no generation
# ./make-comic.sh ./my-comic -n # Fresh run (ignore previous)
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
DATA_DIR="${1:?Usage: ./make-comic.sh <data-folder>}"
shift
# Check prerequisites
if [ -z "$GOOGLE_API_KEY" ]; then
echo "Error: GOOGLE_API_KEY environment variable must be set."
echo "Get one at https://aistudio.google.com/apikey"
exit 1
fi
if ! command -v bun &> /dev/null; then
echo "Error: bun is required. Install: https://bun.sh"
exit 1
fi
if ! command -v npx &> /dev/null; then
echo "Error: npx (Node.js) is required."
exit 1
fi
echo "╔══════════════════════════════════════╗"
echo "║ Comic Creator v1.0.0 ║"
echo "╚══════════════════════════════════════╝"
echo ""
echo "Data: $DATA_DIR"
echo ""
# Run the hank
npx hankweave "$SCRIPT_DIR/hank.json" "$DATA_DIR" "$@"