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