-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·59 lines (44 loc) · 1.79 KB
/
install.sh
File metadata and controls
executable file
·59 lines (44 loc) · 1.79 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
#!/bin/sh
if ! which hnt-chat > /dev/null 2>&1
then
echo "Hinata is a dependency of Cathedral, but you don't have it installed."
echo "Hinata's only dependency is Go. More info: https://hnt-agent.org"
echo "Would you like me to automatically install Hinata for you? (y/n)"
read -r option
[ "$option" = y ] || [ "$option" = Y ] || exit 1
curl "https://hnt-agent.org/install" | sh
fi
set -e
# 1. cds to the directory the script is in
cd "$(dirname "$0")"
# Check if Go is available (required for building)
if ! which go > /dev/null 2>&1
then
echo "Go is required to build Cathedral. Please install Go from https://go.dev"
exit 1
fi
# Determine config directory path, using $HOME/.config as a fallback for XDG_CONFIG_HOME
# and make the config dir if it doesn't exist.
CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/cathedral/grimoire"
mkdir -p "$CONFIG_DIR"
# 2. copies ./grimoire/* to XDG_CONFIG_HOME/cathedral/grimoire/*
cp -r grimoire/* "$CONFIG_DIR"
echo "cathedral: installed prompts to $CONFIG_DIR"
# Determine data directory path, using $HOME/.local/share as a fallback for XDG_DATA_HOME
# and copy webui files there
DATA_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/cathedral/webui"
mkdir -p "$DATA_DIR"
# Copy webui files to data directory
cp -r webui/* "$DATA_DIR"
echo "cathedral: installed webui to $DATA_DIR"
# 3. Build Cathedral using the build script
echo "cathedral: building binary..."
./build.sh
# 4. Install the binaries to /usr/local/bin
sudo cp bin/cathedral /usr/local/bin/cathedral
sudo chmod +x /usr/local/bin/cathedral
echo "cathedral: installed cathedral binary to /usr/local/bin/"
sudo cp bin/cathedral-web /usr/local/bin/cathedral-web
sudo chmod +x /usr/local/bin/cathedral-web
echo "cathedral: installed cathedral-web binary to /usr/local/bin/"
echo "cathedral: installation complete!"