~bigbes/sourcehut-root

ref: d9aac8a275e68ad733cd154140f496d8ff2309ae sourcehut-root/justfile -rw-r--r-- 993 bytes
d9aac8a2 — Eugene Blikh Make sourcehut-custom-service a global skill installed via Justfile 26 days ago
                                                                                
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
_default:
    @just --list

# Skills backed up in this repo, installed into ~/.claude/skills (repo -> ~/.claude)
skills := "sourcehut-ci sourcehut-custom-service"

# Absolute path to this repo (the SourceHut documentation mirror), substituted
# into skills for the __SRHT_MIRROR__ placeholder at install time.
mirror := justfile_directory()

# Install the backed-up skills into ~/.claude/skills
install:
    #!/usr/bin/env bash
    set -euo pipefail
    for skill in {{skills}}; do
        src="skills/$skill"
        dst="$HOME/.claude/skills/$skill"
        mkdir -p "$dst"
        rsync -a --delete --exclude='.*' "$src/" "$dst/"
        # Substitute the mirror-root placeholder with this repo's absolute path
        find "$dst" -type f -name '*.md' -print0 | while IFS= read -r -d '' f; do
            sed "s|__SRHT_MIRROR__|{{mirror}}|g" "$f" > "$f.tmp" && mv "$f.tmp" "$f"
        done
        echo "Installed $skill -> $dst ($(find "$dst" -type f | wc -l | tr -d ' ') files)"
    done