-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·84 lines (74 loc) · 2.08 KB
/
build.sh
File metadata and controls
executable file
·84 lines (74 loc) · 2.08 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env bash
#
# ShipNode Build Script
# Bundles all modules into a single distributable file
#
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
LIB_DIR="$SCRIPT_DIR/lib"
OUTPUT_FILE="$SCRIPT_DIR/shipnode"
# Modules to include (in order of dependency)
MODULES=(
"lib/core.sh"
"lib/release.sh"
"lib/database.sh"
"lib/backup.sh"
"lib/users.sh"
"lib/framework.sh"
"lib/validation.sh"
"lib/prompts.sh"
"lib/commands/config.sh"
"lib/commands/users-yaml.sh"
"lib/commands/user.sh"
"lib/commands/mkpasswd.sh"
"lib/commands/init.sh"
"lib/commands/setup.sh"
"lib/commands/deploy.sh"
"lib/commands/status.sh"
"lib/commands/unlock.sh"
"lib/commands/rollback.sh"
"lib/commands/migrate.sh"
"lib/commands/env.sh"
"lib/commands/backup.sh"
"lib/commands/cloudflare.sh"
"lib/commands/help.sh"
"lib/commands/main.sh"
)
echo "Building ShipNode..."
echo ""
# Create header
cat > "$OUTPUT_FILE" << 'HEADER'
#!/usr/bin/env bash
#
# ShipNode - Simple Node.js Deployment Tool
# Version: 1.1.0
#
# This file is auto-generated. Do not edit directly.
# Source: https://github.com/devalade/shipnode
#
set -e
HEADER
# Concatenate all modules
for module in "${MODULES[@]}"; do
module_path="$SCRIPT_DIR/$module"
if [ -f "$module_path" ]; then
echo " → Adding $(basename "$module")"
# Add module header comment
echo "" >> "$OUTPUT_FILE"
echo "# ============================================================================" >> "$OUTPUT_FILE"
echo "# MODULE: $(basename "$module")" >> "$OUTPUT_FILE"
echo "# ============================================================================" >> "$OUTPUT_FILE"
echo "" >> "$OUTPUT_FILE"
# Append module content
cat "$module_path" >> "$OUTPUT_FILE"
else
echo " ✗ Warning: $module not found"
fi
done
# Make executable
chmod +x "$OUTPUT_FILE"
echo ""
echo "✓ Build complete: $OUTPUT_FILE"
echo ""
echo "File size: $(du -h "$OUTPUT_FILE" | cut -f1)"
echo "Lines: $(wc -l < "$OUTPUT_FILE")"