diff --git a/install.sh b/install.sh index ef64cad..5acb9ac 100755 --- a/install.sh +++ b/install.sh @@ -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" \ No newline at end of file