Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automating path addition, while checking if path was already added #7

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
current_dr=$(pwd)/bin

#add ope tool to path so user can use in any directory
echo " " >> ${HOME}/.bashrc
echo "export PATH=$current_dr:\$PATH" >> ${HOME}/.bashrc
#rerun bashrc so it's updated to have ope
source ${HOME}/.bashrc
#if path was not already added, add path
if ! grep -q -s "export PATH=$current_dr:\$PATH" ~/.bashrc; then
echo "export PATH=$current_dr:\$PATH" >> ~/.bashrc #add it to path
source ~/.bashrc #rerun bashrc to reset shell
fi

#tell user ope tool has been installed
echo "ope has been added to the path successfully"
echo "ope has been added to the path successfully"