[bin] On bootstrap, hide directories
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -70,7 +70,7 @@ _fake*
|
||||
fish/.config/fish/conf.d/virtualfish-loader.fish
|
||||
fish/.config/fish/functions/fzf_key_bindings.fish
|
||||
default.target.wants
|
||||
/bin/.bin/Microsoft Bing for Safari.app/
|
||||
bin/.local/bin/git-cu
|
||||
/launchd/Library/LaunchAgents/com.microsoft.msbwapp.plist
|
||||
/launchd/Library/LaunchAgents/com.microsoft.msbwupdater.plist
|
||||
Bing Wallpaper1.1.3.app
|
||||
|
||||
@ -8,6 +8,7 @@ DOTFILES_REPO="https://code.lab.unbl.ink/secstate/dotfiles"
|
||||
DOTFILES_DIR="${DOTFILES_DIR:-$HOME/.dotfiles}"
|
||||
OMZ_DIR="${ZSH:-$HOME/.oh-my-zsh}"
|
||||
DOOM_DIR="${DOOM_DIR:-$HOME/.emacs.d}"
|
||||
BACKUP_DIR="$HOME/.backup"
|
||||
|
||||
OS="$(uname -s)"
|
||||
PLATFORM=""
|
||||
@ -55,7 +56,7 @@ fi
|
||||
# -------- Install basics (git, stow, zsh, curl, make) --------
|
||||
install_arch() {
|
||||
log "Installing prerequisites (Arch/EndeavourOS)..."
|
||||
sudo pacman -Sy --needed --noconfirm git stow zsh curl make openssh
|
||||
sudo pacman -Sy --needed --noconfirm git stow zsh curl make openssh asdf
|
||||
}
|
||||
|
||||
install_fedora() {
|
||||
@ -78,7 +79,7 @@ install_macos() {
|
||||
|
||||
log "Installing prerequisites (macOS via brew)..."
|
||||
brew update
|
||||
brew install git stow zsh curl gnu-make
|
||||
brew install git stow zsh curl gnu-make asdf
|
||||
}
|
||||
|
||||
install_freebsd() {
|
||||
@ -114,9 +115,23 @@ elif [[ "$PLATFORM" == "macos" ]]; then
|
||||
fi
|
||||
|
||||
log "Backing up existing files"
|
||||
(cd ~ && mv .zshrc .zshrc.bak)
|
||||
(cd ~ && mv .bashrc .bashrc.bak)
|
||||
(cd ~ && mv .config/gtk-3.0 .config/gtk-3.0.bak)
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
|
||||
(cd ~ && mv .zshrc "$BACKUP_DIR/")
|
||||
(cd ~ && mv .bashrc "$BACKUP_DIR/")
|
||||
(cd ~ && mv .config/gtk-3.0 "$BACKUP_DIR/")
|
||||
|
||||
log "Moving empty XDG user directories to .backup"
|
||||
if [[ "$PLATFORM" != "macos" ]]; then
|
||||
for dir in Desktop Documents Downloads Music Pictures Public Templates Videos; do
|
||||
target="$HOME/$dir"
|
||||
if [[ -d "$target" ]]; then
|
||||
if [[ -z "$(ls -A "$target" 2>/dev/null)" ]]; then
|
||||
mv "$target" "$BACKUP_DIR/"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
log "Running $MAKE_CMD in dotfiles repo..."
|
||||
(cd "$DOTFILES_DIR" && "$MAKE_CMD")
|
||||
|
||||
Reference in New Issue
Block a user