forked from LukastGeorge/Grainlify-Backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-dev.sh
More file actions
executable file
路39 lines (32 loc) 路 1.07 KB
/
Copy pathrun-dev.sh
File metadata and controls
executable file
路39 lines (32 loc) 路 1.07 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
#!/bin/bash
# Development server with auto-reload using air
# This script will automatically restart the server when files change
# Add ~/go/bin to PATH if not already there
if [[ ":$PATH:" != *":$HOME/go/bin:"* ]]; then
export PATH="$PATH:$HOME/go/bin"
fi
# Check if air is installed
if ! command -v air &> /dev/null; then
echo "Air is not installed. Installing..."
go install github.com/air-verse/air@latest
# Add to PATH again after installation
if [[ ":$PATH:" != *":$HOME/go/bin:"* ]]; then
export PATH="$PATH:$HOME/go/bin"
fi
# Check again
if ! command -v air &> /dev/null; then
echo ""
echo "鈿狅笍 Error: Air installation failed or ~/go/bin is not in PATH"
echo "Please add this to your ~/.zshrc or ~/.bashrc:"
echo " export PATH=\$PATH:\$HOME/go/bin"
echo ""
echo "Then run this script again."
exit 1
fi
fi
# Run air
echo "馃殌 Starting development server with auto-reload..."
echo "馃摑 Watching for file changes in: $(pwd)"
echo "馃洃 Press Ctrl+C to stop"
echo ""
air