We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5bfedff commit 6d2b2b7Copy full SHA for 6d2b2b7
1 file changed
install.sh
@@ -1,11 +1,11 @@
1
#!/bin/bash
2
current_dr=$(pwd)/bin
3
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
+#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
9
10
#tell user ope tool has been installed
11
-echo "ope has been added to the path successfully"
+echo "ope has been added to the path successfully"
0 commit comments