-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·61 lines (47 loc) · 1.79 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·61 lines (47 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
60
61
#!/usr/bin/env bash
# DevDay one-line installer
# Usage: curl -fsSL https://raw.githubusercontent.com/Magnussmari/devday/main/install.sh | bash
# Reinstall idempotently. Pass --uninstall to remove.
set -euo pipefail
REPO="Magnussmari/devday"
REF="${DEVDAY_REF:-main}"
BASE="https://raw.githubusercontent.com/${REPO}/${REF}"
CLAUDE_DIR="${CLAUDE_HOME:-$HOME/.claude}"
SKILL_DIR="${CLAUDE_DIR}/skills/DevDay"
CMD_DIR="${CLAUDE_DIR}/commands"
c_green=$'\033[32m'; c_dim=$'\033[2m'; c_red=$'\033[31m'; c_reset=$'\033[0m'
say() { printf "%s\n" "$*"; }
ok() { printf "${c_green}✓${c_reset} %s\n" "$*"; }
note() { printf "${c_dim} %s${c_reset}\n" "$*"; }
err() { printf "${c_red}✗${c_reset} %s\n" "$*" >&2; }
need() {
command -v "$1" >/dev/null 2>&1 || { err "missing dependency: $1"; exit 1; }
}
uninstall() {
rm -rf "$SKILL_DIR"
rm -f "$CMD_DIR/devday.md" "$CMD_DIR/devday-log.md"
ok "DevDay uninstalled (skill + commands removed from $CLAUDE_DIR)"
exit 0
}
[[ "${1:-}" == "--uninstall" ]] && uninstall
need curl
need mkdir
say "Installing DevDay (ref: ${REF}) into ${CLAUDE_DIR}"
mkdir -p "$SKILL_DIR" "$CMD_DIR"
fetch() {
local src="$1" dst="$2"
curl -fsSL "$src" -o "$dst.tmp" || { err "download failed: $src"; rm -f "$dst.tmp"; exit 1; }
mv "$dst.tmp" "$dst"
ok "$(basename "$dst")"
note "$dst"
}
fetch "${BASE}/skills/devday/SKILL.md" "${SKILL_DIR}/SKILL.md"
fetch "${BASE}/commands/devday.md" "${CMD_DIR}/devday.md"
fetch "${BASE}/commands/devday-log.md" "${CMD_DIR}/devday-log.md"
cat <<EOF
${c_green}DevDay installed.${c_reset}
cd <any git repo>
/devday-log ${c_dim}# append a checkpoint (auto-orients on first run)${c_dim}
/devday ${c_dim}# synthesise the day at end of session${c_reset}
Uninstall: curl -fsSL ${BASE}/install.sh | bash -s -- --uninstall
EOF