-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
40 lines (32 loc) · 1.37 KB
/
justfile
File metadata and controls
40 lines (32 loc) · 1.37 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
default: install
# Variables
home_dir := env_var('HOME')
# Install the Go application
install:
go install -tags "fts5" .
mac-service-install: install
mkdir -p "{{home_dir}}/Library/LaunchAgents"
echo "Installing launch agent..."
sed 's|$HOME|{{home_dir}}|g' template.plist > "{{home_dir}}/Library/LaunchAgents/com.lukaswerner.mark.server.plist"
launchctl unload "{{home_dir}}/Library/LaunchAgents/com.lukaswerner.mark.server.plist" 2>/dev/null || true
launchctl load "{{home_dir}}/Library/LaunchAgents/com.lukaswerner.mark.server.plist"
echo "Launch agent installed and loaded"
# Uninstall the launch agent
mac-service-uninstall:
launchctl unload "{{home_dir}}/Library/LaunchAgents/com.lukaswerner.mark.server.plist" 2>/dev/null || true
rm -f "{{home_dir}}/Library/LaunchAgents/com.lukaswerner.mark.server.plist"
echo "Launch agent uninstalled"
# Check status of the service
mac-status:
launchctl list | grep "com.lukaswerner.mark.server" || echo "Service not running"
# View logs
mac-logs:
echo "=== STDOUT ==="
cat /tmp/mark.server.stdout.log 2>/dev/null || echo "No stdout log found"
echo -e "\n=== STDERR ==="
cat /tmp/mark.server.stderr.log 2>/dev/null || echo "No stderr log found"
# Restart the service
mac-restart: mac-service-uninstall mac-service-install
# Clean up everything
clean:
rm -f {{home_dir}}/.lib/crsqlite.dylib