Compare commits

...

4 Commits

Author SHA1 Message Date
Peter Wood
1287168961 fix: Ensure nvm loading only occurs if nvm is available 2025-11-29 10:05:55 -05:00
Peter Wood
645d10d548 fix: Correct echo placement after installing Fabric binary 2025-11-29 09:52:32 -05:00
Peter Wood
fa44ab2e45 use $HOME var instead of a hardcoded username 2025-11-29 09:48:51 -05:00
Peter Wood
40cbecdebf feat: Improve bootstrap script to handle existing directories and cloning logic 2025-11-29 09:37:00 -05:00
3 changed files with 36 additions and 22 deletions

View File

@@ -3,7 +3,7 @@
export PATH=$PATH:$HOME/.local/bin export PATH=$PATH:$HOME/.local/bin
# Path to your oh-my-zsh installation. # Path to your oh-my-zsh installation.
export ZSH="/home/acedanger/.oh-my-zsh" export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will # Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case, # load a random theme each time oh-my-zsh is loaded, in which case,
@@ -100,6 +100,8 @@ export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Automatically use node version specified in .nvmrc if present # Automatically use node version specified in .nvmrc if present
# Only enable if nvm is loaded
if command -v nvm_find_nvmrc > /dev/null 2>&1; then
autoload -U add-zsh-hook autoload -U add-zsh-hook
load-nvmrc() { load-nvmrc() {
local nvmrc_path="$(nvm_find_nvmrc)" local nvmrc_path="$(nvm_find_nvmrc)"
@@ -116,8 +118,9 @@ load-nvmrc() {
} }
add-zsh-hook chpwd load-nvmrc add-zsh-hook chpwd load-nvmrc
load-nvmrc load-nvmrc
fi
[[ -s /home/acedanger/.autojump/etc/profile.d/autojump.sh ]] && source /home/acedanger/.autojump/etc/profile.d/autojump.sh [[ -s $HOME/.autojump/etc/profile.d/autojump.sh ]] && source $HOME/.autojump/etc/profile.d/autojump.sh
# Enable bash completion compatibility in zsh # Enable bash completion compatibility in zsh
autoload -U +X bashcompinit && bashcompinit autoload -U +X bashcompinit && bashcompinit

View File

@@ -61,14 +61,24 @@ if ! command -v git &>/dev/null; then
esac esac
fi fi
# Create shell directory if it doesn't exist
mkdir -p "$HOME/shell"
# Clone or update repository # Clone or update repository
if [ -d "$DOTFILES_DIR" ]; then if [ -d "$DOTFILES_DIR/.git" ]; then
echo -e "${YELLOW}Updating existing shell repository...${NC}" echo -e "${YELLOW}Updating existing shell repository...${NC}"
cd "$DOTFILES_DIR" cd "$DOTFILES_DIR"
git pull origin $DOTFILES_BRANCH git pull origin $DOTFILES_BRANCH
elif [ -d "$DOTFILES_DIR" ]; then
echo -e "${YELLOW}Directory exists but is not a git repository.${NC}"
# Check if directory is empty
if [ -z "$(ls -A "$DOTFILES_DIR")" ]; then
echo -e "${YELLOW}Directory is empty. Cloning...${NC}"
git clone "https://github.com/$DOTFILES_REPO.git" "$DOTFILES_DIR"
else
echo -e "${YELLOW}Backing up existing directory...${NC}"
mv "$DOTFILES_DIR" "${DOTFILES_DIR}.bak.$(date +%s)"
echo -e "${YELLOW}Cloning shell repository...${NC}"
git clone "https://github.com/$DOTFILES_REPO.git" "$DOTFILES_DIR"
fi
cd "$DOTFILES_DIR"
else else
echo -e "${YELLOW}Cloning shell repository...${NC}" echo -e "${YELLOW}Cloning shell repository...${NC}"
git clone "https://github.com/$DOTFILES_REPO.git" "$DOTFILES_DIR" git clone "https://github.com/$DOTFILES_REPO.git" "$DOTFILES_DIR"

View File

@@ -291,7 +291,8 @@ for pkg in "${special_installs[@]}"; do
# Download and install the latest Fabric binary for Linux AMD64 # Download and install the latest Fabric binary for Linux AMD64
curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-linux-amd64 -o /tmp/fabric curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-linux-amd64 -o /tmp/fabric
chmod +x /tmp/fabric chmod +x /tmp/fabric
sudo mv /tmp/fabric /usr/local/bin/fabric echo -e "${GREEN}Fabric binary installed successfully!${NC}" sudo mv /tmp/fabric /usr/local/bin/fabric
echo -e "${GREEN}Fabric binary installed successfully!${NC}"
# Verify installation # Verify installation
if fabric --version; then if fabric --version; then