Repository navigation
Expand file tree
/
Copy pathsimple-build-and-deploy.sh
More file actions
executable file
·96 lines (77 loc) · 2.38 KB
/
Copy pathsimple-build-and-deploy.sh
File metadata and controls
executable file
·96 lines (77 loc) · 2.38 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
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
# Simple Build and Deploy Script for Liaison
# This script builds the liaison package and makes it available
echo "🚀 Building Liaison Package"
echo "=========================="
echo ""
# Check if we're in the right directory
if [[ ! -f "packages/liaison/package.json" ]]; then
echo "❌ Error: Run this script from the root of the liaison-toolkit project"
echo " Expected: /home/pwarnock/github/liaison-toolkit"
exit 1
fi
# Check if bun is available
if ! command -v bun &> /dev/null; then
echo "❌ Error: Bun is not installed"
echo " Please install Bun: curl -fsSL https://bun.sh/install | bash"
exit 1
fi
echo "✅ Prerequisites check passed"
echo ""
# Build the package
echo "📦 Building liaison package..."
cd packages/liaison
bun run build
if [ $? -ne 0 ]; then
echo "❌ Build failed"
exit 1
fi
echo "✅ Build completed successfully"
echo ""
# Test the built package
echo "🧪 Testing built package..."
node dist/cli.js -h
if [ $? -ne 0 ]; then
echo "❌ Test failed"
exit 1
fi
echo "✅ Test passed"
echo ""
# Create a global symlink
echo "🔗 Creating global symlink..."
cd /home/pwarnock/github/liaison-toolkit
# Create symlink in ~/.local/bin (common user PATH)
mkdir -p ~/.local/bin
ln -sf "$PWD/packages/liaison/dist/cli.js" ~/.local/bin/liaison
# Make it executable
chmod +x ~/.local/bin/liaison
echo "✅ Symlink created at ~/.local/bin/liaison"
echo ""
# Add ~/.local/bin to PATH if not already there
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
echo "📝 Adding ~/.local/bin to PATH..."
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
echo "✅ Added to PATH in ~/.bashrc and ~/.zshrc"
echo ""
echo "⚠️ IMPORTANT: Run 'source ~/.bashrc' or restart your terminal to use 'liaison' command"
fi
# Test the symlink
echo "✅ Verifying installation..."
~/.local/bin/liaison -h
if [ $? -ne 0 ]; then
echo "❌ Verification failed"
exit 1
fi
echo ""
echo "🎉 Success! Liaison is now available"
echo ""
echo "You can now use liaison from anywhere:"
echo " ~/.local/bin/liaison -h # Use with full path"
echo " liaison -h # Use with short name (after sourcing ~/.bashrc)"
echo ""
echo "To disable caching:"
echo " DISABLE_CACHE=true liaison -h"
echo ""
echo "To unlink later:"
echo " rm ~/.local/bin/liaison"