Compare commits
4 Commits
870dc6ac58
...
f1a0806dbb
| Author | SHA1 | Date | |
|---|---|---|---|
| f1a0806dbb | |||
| 8069f6f150 | |||
| e149dac313 | |||
|
|
cf8623bca1 |
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 REL="${FILE#$HOME/}"
|
||||||
local DEST="$DOTFILES_DIR/$PACKAGE/$REL"
|
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")"
|
mkdir -p "$(dirname "$DEST")"
|
||||||
mv "$FILE" "$DEST"
|
mv "$FILE" "$DEST"
|
||||||
echo "Moved: $FILE -> $DEST"
|
echo "Moved: $FILE -> $DEST"
|
||||||
|
|||||||
21
install.sh
21
install.sh
@@ -25,6 +25,25 @@ DISTRO=$(detect_distro)
|
|||||||
# Dependencies
|
# Dependencies
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# 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
|
case "$DISTRO" in
|
||||||
endeavouros)
|
endeavouros)
|
||||||
# EndeavourOS is Arch-based, use pacman
|
# EndeavourOS is Arch-based, use pacman
|
||||||
@@ -52,6 +71,7 @@ case "$DISTRO" in
|
|||||||
firefox
|
firefox
|
||||||
)
|
)
|
||||||
|
|
||||||
|
check_arch_updates
|
||||||
echo "Installing packages for EndeavourOS..."
|
echo "Installing packages for EndeavourOS..."
|
||||||
sudo pacman -S --noconfirm "${PACMAN_PACKAGES[@]}"
|
sudo pacman -S --noconfirm "${PACMAN_PACKAGES[@]}"
|
||||||
;;
|
;;
|
||||||
@@ -110,6 +130,7 @@ case "$DISTRO" in
|
|||||||
firefox
|
firefox
|
||||||
)
|
)
|
||||||
|
|
||||||
|
check_arch_updates
|
||||||
echo "Installing packages for Arch Linux..."
|
echo "Installing packages for Arch Linux..."
|
||||||
sudo pacman -S --noconfirm "${PACMAN_PACKAGES[@]}"
|
sudo pacman -S --noconfirm "${PACMAN_PACKAGES[@]}"
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user