dotfiles v1.0.7

This commit is contained in:
Your Name
2026-06-19 20:23:24 +00:00
parent 4a80a34d84
commit 0721750388
2 changed files with 29 additions and 13 deletions

View File

@@ -403,10 +403,8 @@ end
# 3. Copies the templates from the cloned repo into DOTFILES_DIR
# 4. Re-applies every template to its target location
#
# The config.fish itself is NOT overwritten — that would require a shell
# restart to take effect. Instead, sync copies the *templates* from the
# upstream repo, then re-applies them. To update the framework logic
# itself (the *.fish files), run the update command shown after sync.
# Sync also copies config.fish and functions/ from upstream, then
# automatically restarts the shell if framework files changed.
# ══════════════════════════════════════════════════════════════════════════════
function dotfiles_sync -d "Pull remote updates and re-apply all dotfiles"
@@ -453,18 +451,36 @@ function dotfiles_sync -d "Pull remote updates and re-apply all dotfiles"
echo "Re-applying dotfiles ..."
dotfiles_update
# ── Step 5: Clean up ───────────────────────────────────────────────────
# ── Step 5: Copy framework files (config.fish, functions/) ─────────────
echo ""
echo "Updating framework files ..."
set -l had_updates 0
if test -f "$tmpdir/.config/fish/config.fish"
command cp "$tmpdir/.config/fish/config.fish" "$__fish_config_dir/config.fish"
echo " config.fish updated"
set had_updates 1
end
if test -d "$tmpdir/.config/fish/functions"
command cp -r "$tmpdir/.config/fish/functions/." "$__fish_config_dir/functions/"
echo " functions/ updated"
set had_updates 1
end
# ── Step 6: Clean up ───────────────────────────────────────────────────
command rm -rf "$tmpdir"
echo ""
echo "Sync complete."
echo ""
echo "NOTE: framework updates (config.fish, functions/) require a manual"
echo "copy and shell restart. To apply them:"
echo ""
echo " git clone $DOTFILES_REPO_URL /tmp/dotfiles-update"
echo " cp -r /tmp/dotfiles-update/.config/fish/config.fish ~/.config/fish/"
echo " cp -r /tmp/dotfiles-update/.config/fish/functions/ ~/.config/fish/"
echo " exec fish"
# ── Step 7: Restart shell to apply framework changes ───────────────────
if test "$had_updates" -eq 1
if status is-interactive
echo "Restarting shell to apply changes ..."
exec fish
else
echo "Framework files updated. Restart your shell: exec fish"
end
end
end