-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathflx
More file actions
executable file
·62 lines (54 loc) · 1.66 KB
/
Copy pathflx
File metadata and controls
executable file
·62 lines (54 loc) · 1.66 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
# Flamelex launcher script
# Boots Flamelex from anywhere on the system using the production release
# By default, always rebuilds to ensure latest code is running
set -e
# Get the directory where this script is located
FLAMELEX_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Change to the flamelex directory
cd "$FLAMELEX_DIR"
# Parse command line flags
SKIP_BUILD=false
CLEAN_BUILD=false
for arg in "$@"; do
case $arg in
-s|--skip)
SKIP_BUILD=true
shift
;;
-c|--clean)
CLEAN_BUILD=true
shift
;;
-h|--help)
echo "Flamelex launcher"
echo ""
echo "Usage: flx [options]"
echo ""
echo "Options:"
echo " -s, --skip Skip rebuild (faster startup)"
echo " -c, --clean Clean build directory and rebuild"
echo " -h, --help Show this help message"
echo ""
echo "By default, flx always rebuilds to ensure latest code."
exit 0
;;
esac
done
# Build/rebuild logic
if [ "$SKIP_BUILD" = true ]; then
echo "Skipping build..."
elif [ "$CLEAN_BUILD" = true ]; then
echo "Cleaning build artifacts..."
rm -rf _build/prod
echo "Building production release from scratch..."
MIX_ENV=prod mix release
elif [ ! -d "_build/prod/rel/flamelex" ]; then
echo "Building production release for the first time..."
MIX_ENV=prod mix release
else
echo "Rebuilding production release..."
MIX_ENV=prod mix release --overwrite
fi
# Launch Flamelex
exec ./_build/prod/rel/flamelex/bin/flamelex start "$@"