File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -372,6 +372,13 @@ function add2virtualenv () {
372372 return 1
373373 fi
374374
375+ remove=0
376+ if [ " $1 " = " -d" ]
377+ then
378+ remove=1
379+ shift
380+ fi
381+
375382 if [ ! -x " $path_file " ]
376383 then
377384 echo " import sys; sys.__plen = len(sys.path)" >> " $path_file "
@@ -385,8 +392,14 @@ function add2virtualenv () {
385392 then
386393 echo " Warning: Converting \" $pydir \" to \" $absolute_path \" " 1>&2
387394 fi
395+
388396 contents=$( cat " $path_file " )
389- echo " $contents " | sed " 1a $absolute_path " > " $path_file "
397+ if [ $remove -eq 1 ]
398+ then
399+ echo " $contents " | sed " \:^$absolute_path $: d" > " $path_file "
400+ else
401+ echo " $contents " | sed " 1a $absolute_path " > " $path_file "
402+ fi
390403 done
391404 return 0
392405}
You can’t perform that action at this time.
0 commit comments