mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 00:00:13 -08:00
Compare commits
4 Commits
8ceeeda560
...
1287168961
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1287168961 | ||
|
|
645d10d548 | ||
|
|
fa44ab2e45 | ||
|
|
40cbecdebf |
@@ -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,24 +100,27 @@ 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
|
||||||
autoload -U add-zsh-hook
|
# Only enable if nvm is loaded
|
||||||
load-nvmrc() {
|
if command -v nvm_find_nvmrc > /dev/null 2>&1; then
|
||||||
local nvmrc_path="$(nvm_find_nvmrc)"
|
autoload -U add-zsh-hook
|
||||||
if [ -n "$nvmrc_path" ]; then
|
load-nvmrc() {
|
||||||
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
|
local nvmrc_path="$(nvm_find_nvmrc)"
|
||||||
if [ "$nvmrc_node_version" = "N/A" ]; then
|
if [ -n "$nvmrc_path" ]; then
|
||||||
nvm install
|
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
|
||||||
elif [ "$nvmrc_node_version" != "$(nvm version)" ]; then
|
if [ "$nvmrc_node_version" = "N/A" ]; then
|
||||||
nvm use
|
nvm install
|
||||||
|
elif [ "$nvmrc_node_version" != "$(nvm version)" ]; then
|
||||||
|
nvm use
|
||||||
|
fi
|
||||||
|
elif [ -n "$(PWD=$OLDPWD nvm_find_nvmrc)" ] && [ "$(nvm version)" != "$(nvm version default)" ]; then
|
||||||
|
nvm use default
|
||||||
fi
|
fi
|
||||||
elif [ -n "$(PWD=$OLDPWD nvm_find_nvmrc)" ] && [ "$(nvm version)" != "$(nvm version default)" ]; then
|
}
|
||||||
nvm use default
|
add-zsh-hook chpwd load-nvmrc
|
||||||
fi
|
load-nvmrc
|
||||||
}
|
fi
|
||||||
add-zsh-hook chpwd load-nvmrc
|
|
||||||
load-nvmrc
|
|
||||||
|
|
||||||
[[ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user