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

@@ -38,7 +38,7 @@
# DOTFILES_DIR holds the template files; DOTFILES_BACKUP_DIR holds backups # DOTFILES_DIR holds the template files; DOTFILES_BACKUP_DIR holds backups
# and the last-update-check timestamp. # and the last-update-check timestamp.
set -g DOTFILES_VERSION "1.0.6" set -g DOTFILES_VERSION "1.0.7"
# --- Remote repository (set this to enable auto-updates) -------------------- # --- Remote repository (set this to enable auto-updates) --------------------
# Example: # Example:

View File

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