Files
MyBlog/.codex/skills/myblog-blog-writer/scripts/install_global.sh
T
2026-05-13 15:28:05 +08:00

17 lines
420 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
skill_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
target_dir="${CODEX_HOME:-$HOME/.codex}/skills"
target="${target_dir}/myblog-blog-writer"
mkdir -p "${target_dir}"
if [[ -e "${target}" && ! -L "${target}" ]]; then
echo "Refusing to replace existing non-symlink: ${target}" >&2
exit 1
fi
ln -sfn "${skill_dir}" "${target}"
echo "Linked ${target} -> ${skill_dir}"