ofek / userpath

Cross-platform tool for adding locations to the user PATH, no elevated privileges required!
MIT License
151 stars 20 forks source link

detect if path is already added to a file? #10

Closed AlJohri closed 4 years ago

AlJohri commented 4 years ago

while you try to detect if the path is already added using the PATH variable, can you add an additional check to prevent appending to the file if the string is already present?

Screen Shot 2019-07-18 at 2 21 00 PM

for example, if export PATH="$PATH:/randompath" is already present in the file, don't try to add it again. even without --force, userpath append --shell bash --home "temphome" /randompath 1>/dev/null 2>&1 will continue appending to the file