-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev-install.sh
More file actions
executable file
·62 lines (55 loc) · 2.41 KB
/
Copy pathdev-install.sh
File metadata and controls
executable file
·62 lines (55 loc) · 2.41 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
#!/bin/sh
set -e
INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}"
BINARY_NAME="jooto"
REPO_DIR="$(cd "$(dirname "$0")" && pwd)"
# Version: datetime + git commit hash
BUILD_DATE=$(date +"%Y%m%d%H%M%S")
GIT_HASH=$(git rev-parse --short HEAD)
VERSION="dev-${BUILD_DATE}-${GIT_HASH}"
# Build
echo "Building ${BINARY_NAME} (version: ${VERSION})..."
go build -ldflags "-X github.com/PRTIMES/jooto-cli/cmd.version=${VERSION}" -o "$BINARY_NAME" .
echo "Build succeeded."
# Install
echo "Installing ${BINARY_NAME} to ${INSTALL_DIR}..."
mkdir -p "$INSTALL_DIR" 2>/dev/null || true
if [ -w "$INSTALL_DIR" ]; then
mv "${BINARY_NAME}" "${INSTALL_DIR}/${BINARY_NAME}"
else
echo "Write permission denied for ${INSTALL_DIR}, using sudo..."
sudo mv "${BINARY_NAME}" "${INSTALL_DIR}/${BINARY_NAME}"
fi
echo "Successfully installed ${BINARY_NAME} to ${INSTALL_DIR}/${BINARY_NAME}"
# Claude Code plugin installation (local marketplace)
if command -v claude >/dev/null 2>&1; then
echo ""
printf "Install Claude Code plugin for AI integration? (y/N) "
if read -r INSTALL_PLUGIN < /dev/tty 2>/dev/null; then
case "$INSTALL_PLUGIN" in
[yY]|[yY][eE][sS])
echo "Adding jooto-cli marketplace (local: ${REPO_DIR})..."
if claude plugin marketplace add "${REPO_DIR}"; then
echo "Installing jooto plugin..."
if claude plugin install jooto@jooto-cli; then
echo "Claude Code plugin installed successfully."
echo "Run /jooto in Claude Code to get started."
else
echo "Warning: Failed to install jooto plugin." >&2
echo "You can install manually: claude plugin install jooto@jooto-cli" >&2
fi
else
echo "Warning: Failed to add marketplace." >&2
echo "You can add manually: claude plugin marketplace add ${REPO_DIR}" >&2
fi
;;
*)
echo "Skipping Claude Code plugin installation."
echo "You can install later: claude plugin marketplace add ${REPO_DIR} && claude plugin install jooto@jooto-cli"
;;
esac
else
echo "Skipping Claude Code plugin (non-interactive shell)."
echo "To install: claude plugin marketplace add ${REPO_DIR} && claude plugin install jooto@jooto-cli"
fi
fi