Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfriend99 committed Feb 23, 2024
1 parent 835ff75 commit e995789
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions scripts/install.sh
Expand Up @@ -15,6 +15,14 @@ then
abort "Bash is required to interpret this script."
fi

if [ "/usr/bin/zsh" == "$SHELL" ]; then
PROFILE_FILE="$USER/.zshrc"
elif [ "/usr/bin/bash" == "$SHELL" ]; then
PROFILE_FILE="$USER/.bashrc"
else
PROFILE_FILE="$USER/.profile"
fi

# Check OS.
OS="$(uname)"
if [[ "${OS}" == "Linux" ]]
Expand Down Expand Up @@ -125,15 +133,23 @@ install_blade() {
rm -rf blade

# Now we can move blade back to the home directory.
mv "$1/.blade" "$1/blade"
# mv "$1/.blade" "$1/blade"

# Now link the blade executable to path
echo "Linking Blade..."

if [[ -f "$1/blade/blade" ]]; then
sudo rm -rf "$1/blade/blade"
fi
sudo ln -s "$1/blade/blade" /usr/local/bin/blade
# export to bash profile
echo "export PATH=\$PATH:\"$1/.blade\"" >> "$PROFILE_FILE"

# make available in current session

# shellcheck source=./install.sh
source "$PROFILE_FILE"

# if [[ -f "$1/blade/blade" ]]; then
# sudo rm -rf "$1/blade/blade"
# fi
# sudo ln -s "$1/blade/blade" /usr/local/bin/blade
}

echo "Beginning installation of Blade..."
Expand Down

0 comments on commit e995789

Please sign in to comment.