dotfiles v.1
This commit is contained in:
24
install.fish
24
install.fish
@@ -15,7 +15,7 @@
|
||||
# 3. Replaces or updates ~/.config/fish/ with the contents of the repo
|
||||
# 4. Sources the new config and runs `dotfiles init` to install templates
|
||||
# (~/.tmux.conf, ~/.gitconfig, ~/.config/starship.toml, etc.)
|
||||
# 5. Warns if SSH key is needed and points to the gitea_key helper
|
||||
# 5. Warns if SSH key is needed and points to the keyme helper
|
||||
# 6. Prints next steps
|
||||
#
|
||||
# You can pass a custom repo URL as the first argument:
|
||||
@@ -171,17 +171,23 @@ echo "$GRN ✓$RST Files installed."
|
||||
|
||||
_step "4/5" "Initialising managed dotfiles (~/.tmux.conf, ~/.gitconfig, ...) ..."
|
||||
|
||||
# Source the newly installed config so the `dotfiles` function is available.
|
||||
source "$FISH_CONFIG_DIR/config.fish"
|
||||
|
||||
# Load the dotfiles function file explicitly (auto-load won't fire until
|
||||
# the function is first called in a non-sourced context).
|
||||
# Load the dotfiles function so its built-in defaults (DOTFILES_DIR,
|
||||
# DOTFILES_BACKUP_DIR, DOTFILES_REPO_URL) are available and the
|
||||
# `dotfiles` command can run. Auto-load won't fire in a curl-piped
|
||||
# non-interactive context, so we source it explicitly.
|
||||
if test -f "$FISH_CONFIG_DIR/functions/dotfiles.fish"
|
||||
source "$FISH_CONFIG_DIR/functions/dotfiles.fish"
|
||||
end
|
||||
|
||||
# Persist the SSH repo URL so `dotfiles publish` and `dotfiles sync` work.
|
||||
if test -n "$SSH_REPO"
|
||||
# Also source config.fish for the `gitme` helper and any local overrides.
|
||||
if test -f "$FISH_CONFIG_DIR/config.fish"
|
||||
source "$FISH_CONFIG_DIR/config.fish"
|
||||
end
|
||||
|
||||
# If a custom SSH_REPO was provided via argv[1], persist it so
|
||||
# `dotfiles publish` and `dotfiles sync` use the right remote.
|
||||
# (Otherwise the default in dotfiles.fish applies automatically.)
|
||||
if set -q argv[1]
|
||||
dotfiles repo "$SSH_REPO" 2>/dev/null
|
||||
end
|
||||
|
||||
@@ -226,7 +232,7 @@ if test "$CLONED_SSH" -eq 0
|
||||
echo " To push changes, you need an SSH key set up for Gitea."
|
||||
echo " Run this built-in helper to generate one and configure SSH:"
|
||||
echo ""
|
||||
echo " $(set_color --bold)gitea_key$RST"
|
||||
echo " $(set_color --bold)keyme$RST"
|
||||
echo ""
|
||||
echo " It will create ~/.ssh/id_ed25519_gitea, update ~/.ssh/config,"
|
||||
echo " and print the public key for you to add at:"
|
||||
|
||||
Reference in New Issue
Block a user