rd13_copilot_setup/scripts/deploy.fish
Conrad Schulz 9838c7a0b3 feat: initial copilot workspace setup
- User settings.json with 9 senior-dev behavior rules
- 9 prompt files: requirements, architecture, new-feature, code-review,
  debug, refactor, write-tests, done-check, docker
- git-templates for .github/ and .vscode/ auto-copy on git init
- deploy.sh (macOS/bash) and deploy.fish (Linux/fish) scripts
- copilot-bootstrap.fish for existing/cloned repos
2026-05-29 08:19:50 +00:00

65 lines
3 KiB
Fish
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env fish
# deploy.fish Copilot-Setup auf Linux mit fish-Shell deployen
# Usage: fish scripts/deploy.fish
set REPO_DIR (dirname (status filename))/..
set REPO_DIR (realpath $REPO_DIR)
echo "=== Copilot Setup Deploy (Linux/fish) ==="
echo "Source: $REPO_DIR"
# ── 1. VS Code User-Verzeichnis ermitteln ─────────────────────────────────────
# Remote (VS Code Server)
if test -d /home/(whoami)/.vscode-server/data/User
set VSCODE_USER /home/(whoami)/.vscode-server/data/User
# Flatpak
else if test -d $HOME/.var/app/com.visualstudio.code/config/Code/User
set VSCODE_USER $HOME/.var/app/com.visualstudio.code/config/Code/User
# Standard Linux
else
set VSCODE_USER $HOME/.config/Code/User
end
echo "VS Code User dir: $VSCODE_USER"
# ── 2. User settings.json mergen / anlegen ────────────────────────────────────
if test -f $VSCODE_USER/settings.json
echo " ─ settings.json exists skipping (merge manually if needed)"
echo " Reference: $REPO_DIR/user-settings/settings.json"
else
mkdir -p $VSCODE_USER
cp $REPO_DIR/user-settings/settings.json $VSCODE_USER/settings.json
echo " ✓ settings.json deployed"
end
# ── 3. Prompt Files ───────────────────────────────────────────────────────────
mkdir -p $VSCODE_USER/prompts
for f in $REPO_DIR/prompts/*.prompt.md
set fname (basename $f)
if test -f $VSCODE_USER/prompts/$fname
echo " ─ prompts/$fname already exists, skipping"
else
cp $f $VSCODE_USER/prompts/$fname
echo " ✓ prompts/$fname deployed"
end
end
# ── 4. Git-Templates ──────────────────────────────────────────────────────────
set GIT_TEMPLATE_DIR $HOME/.git-templates
mkdir -p $GIT_TEMPLATE_DIR/.github $GIT_TEMPLATE_DIR/.vscode
cp $REPO_DIR/git-templates/.github/copilot-instructions.md $GIT_TEMPLATE_DIR/.github/
cp $REPO_DIR/git-templates/.vscode/settings.json $GIT_TEMPLATE_DIR/.vscode/
cp $REPO_DIR/git-templates/.vscode/extensions.json $GIT_TEMPLATE_DIR/.vscode/
git config --global init.templateDir $GIT_TEMPLATE_DIR
echo " ✓ git-templates deployed → $GIT_TEMPLATE_DIR"
echo " ✓ git config init.templateDir set"
# ── 5. Bootstrap-Skript ───────────────────────────────────────────────────────
mkdir -p $HOME/.local/bin
cp $REPO_DIR/scripts/copilot-bootstrap.fish $HOME/.local/bin/copilot-bootstrap.fish
chmod +x $HOME/.local/bin/copilot-bootstrap.fish
echo " ✓ copilot-bootstrap.fish installed to ~/.local/bin/"
echo ""
echo "=== Done ==="
echo "Next: Activate Settings Sync in VS Code (Ctrl+Shift+P → 'Settings Sync: Turn On')"