-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·53 lines (44 loc) · 1.53 KB
/
install.sh
File metadata and controls
executable file
·53 lines (44 loc) · 1.53 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
#!/bin/bash
set -e
BINARY_NAME="mem"
INSTALL_DIR="$HOME/.local/bin"
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo "🚀 Installing AI Memoria CLI..."
# Create install directory if it doesn't exist
mkdir -p "$INSTALL_DIR"
# Check if we're in a source directory with a binary in bin/
if [ -f "bin/$BINARY_NAME" ]; then
echo "Found built binary in bin/$BINARY_NAME"
cp "bin/$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME"
chmod +x "$INSTALL_DIR/$BINARY_NAME"
# Check if we're in a downloaded release with the binary in current directory
elif [ -f "./$BINARY_NAME" ]; then
echo "Found binary in current directory"
cp "./$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME"
chmod +x "$INSTALL_DIR/$BINARY_NAME"
else
echo -e "${RED}Error: Binary not found!${NC}"
echo ""
echo "Usage:"
echo " From source: make install"
echo " From release: ./install.sh (run in directory with the binary)"
echo ""
echo "Or download the binary manually and copy it to ~/.local/bin/mem"
exit 1
fi
echo -e "${GREEN}✅ Installed to $INSTALL_DIR/$BINARY_NAME${NC}"
echo ""
# Check if INSTALL_DIR is in PATH
if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
echo -e "${YELLOW}⚠️ $INSTALL_DIR is not in your PATH${NC}"
echo ""
echo "Add this to your ~/.bashrc or ~/.zshrc:"
echo " export PATH=\"\$PATH:$INSTALL_DIR\""
echo ""
echo "Then reload your shell: source ~/.bashrc (or restart terminal)"
echo ""
fi
echo -e "${GREEN}Try it out: $BINARY_NAME --help${NC}"