Skip to content

Commit 6d2b2b7

Browse files
committed
do not reinstall if already added to path
1 parent 5bfedff commit 6d2b2b7

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

install.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22
current_dr=$(pwd)/bin
33

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

1010
#tell user ope tool has been installed
11-
echo "ope has been added to the path successfully"
11+
echo "ope has been added to the path successfully"

0 commit comments

Comments
 (0)