dotfiles v1.0.6
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
# DOTFILES_DIR holds the template files; DOTFILES_BACKUP_DIR holds backups
|
||||
# and the last-update-check timestamp.
|
||||
|
||||
set -g DOTFILES_VERSION "1.0.5"
|
||||
set -g DOTFILES_VERSION "1.0.6"
|
||||
|
||||
# --- Remote repository (set this to enable auto-updates) --------------------
|
||||
# Example:
|
||||
|
||||
@@ -382,11 +382,14 @@ if test -f "$repo_file"
|
||||
set -gx DOTFILES_REPO_URL (command cat "$repo_file")
|
||||
end
|
||||
|
||||
# Ensure there's always a default branch, even if config.fish hasn't been
|
||||
# reloaded after a framework update.
|
||||
# Ensure there's always a default branch and dotfiles directory, even if
|
||||
# config.fish hasn't been reloaded after a framework update.
|
||||
if not set -q DOTFILES_REPO_BRANCH
|
||||
set -gx DOTFILES_REPO_BRANCH "main"
|
||||
end
|
||||
if not set -q DOTFILES_DIR
|
||||
set -gx DOTFILES_DIR "$__fish_config_dir/dotfiles"
|
||||
end
|
||||
|
||||
|
||||
# ══════════════════════════════════════════════════════════════════════════════
|
||||
@@ -434,9 +437,11 @@ function dotfiles_sync -d "Pull remote updates and re-apply all dotfiles"
|
||||
if test -d "$upstream_templates"
|
||||
echo ""
|
||||
echo "Updating templates from upstream ..."
|
||||
# Copy recursively to handle subdirectory templates (e.g. config/).
|
||||
# We use cp -r and then clean up the destination to only keep files.
|
||||
command cp -r "$upstream_templates/." "$DOTFILES_DIR/"
|
||||
if not command cp -r "$upstream_templates/." "$DOTFILES_DIR/"
|
||||
echo "Error: failed to copy templates to $DOTFILES_DIR"
|
||||
command rm -rf "$tmpdir"
|
||||
return 1
|
||||
end
|
||||
echo " templates synced from upstream"
|
||||
else
|
||||
echo "Warning: no dotfiles/ directory found in the upstream repo."
|
||||
|
||||
Reference in New Issue
Block a user