Merge branch 'main' of https://gitea.haugesenspil.dk/jonas/dotfiles
This commit is contained in:
11
.gitmodules
vendored
Normal file
11
.gitmodules
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
[submodule "zshrc/.zsh/plugins/zsh-autosuggestions"]
|
||||
path = zshrc/.zsh/plugins/zsh-autosuggestions
|
||||
url = https://github.com/zsh-users/zsh-autosuggestions
|
||||
|
||||
[submodule "zshrc/.zsh/plugins/zsh-history-substring-search"]
|
||||
path = zshrc/.zsh/plugins/zsh-history-substring-search
|
||||
url = https://github.com/zsh-users/zsh-history-substring-search
|
||||
|
||||
[submodule "zshrc/.zsh/plugins/zsh-syntax-highlighting"]
|
||||
path = zshrc/.zsh/plugins/zsh-syntax-highlighting
|
||||
url = https://github.com/zsh-users/zsh-syntax-highlighting
|
||||
15
dot-add
15
dot-add
@@ -45,6 +45,21 @@ add_one() {
|
||||
local REL="${FILE#$HOME/}"
|
||||
local DEST="$DOTFILES_DIR/$PACKAGE/$REL"
|
||||
|
||||
# If the path is a git repo, add it as a submodule instead of moving files
|
||||
if [[ -d "$FILE/.git" ]]; then
|
||||
local REMOTE
|
||||
REMOTE="$(git -C "$FILE" remote get-url origin 2>/dev/null || true)"
|
||||
if [[ -z "$REMOTE" ]]; then
|
||||
echo "Error: '$FILE' is a git repo but has no remote origin — can't add as submodule" >&2
|
||||
return 1
|
||||
fi
|
||||
mkdir -p "$(dirname "$DEST")"
|
||||
rm -rf "$FILE"
|
||||
git -C "$DOTFILES_DIR" submodule add "$REMOTE" "$PACKAGE/$REL"
|
||||
echo "Added submodule: $REMOTE -> $DEST"
|
||||
return 0
|
||||
fi
|
||||
|
||||
mkdir -p "$(dirname "$DEST")"
|
||||
mv "$FILE" "$DEST"
|
||||
echo "Moved: $FILE -> $DEST"
|
||||
|
||||
19
install.sh
19
install.sh
@@ -41,6 +41,24 @@ COMMON_PACKAGES=(
|
||||
firefox
|
||||
zoxide
|
||||
)
|
||||
# On Arch-based systems, partial upgrades are unsupported — installing a
|
||||
# package that pulls in a newer library breaks packages built against the old
|
||||
# one. The right fix is 'sudo pacman -Syu', but doing that over SSH risks
|
||||
# a dropped connection mid-kernel-upgrade. So we just warn and let the user
|
||||
# decide.
|
||||
check_arch_updates() {
|
||||
sudo pacman -Sy --noconfirm # refresh databases only, no upgrade
|
||||
local updates
|
||||
updates=$(pacman -Qu 2>/dev/null | wc -l)
|
||||
if [[ "$updates" -gt 0 ]]; then
|
||||
echo ""
|
||||
echo "WARNING: $updates system package(s) are out of date."
|
||||
echo " If pacman fails with dependency conflicts, run 'sudo pacman -Syu'"
|
||||
echo " locally (not over SSH, to avoid kernel upgrade risks), then re-run"
|
||||
echo " this script."
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
case "$DISTRO" in
|
||||
endeavouros|arch)
|
||||
@@ -62,6 +80,7 @@ case "$DISTRO" in
|
||||
echo "Installing packages for Fedora..."
|
||||
sudo dnf install -y "${PACKAGES[@]}"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "ERROR: Unsupported distribution: $DISTRO"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user