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 () {
372
372
return 1
373
373
fi
374
374
375
+ remove=0
376
+ if [ " $1 " = " -d" ]
377
+ then
378
+ remove=1
379
+ shift
380
+ fi
381
+
375
382
if [ ! -x " $path_file " ]
376
383
then
377
384
echo " import sys; sys.__plen = len(sys.path)" >> " $path_file "
@@ -385,8 +392,14 @@ function add2virtualenv () {
385
392
then
386
393
echo " Warning: Converting \" $pydir \" to \" $absolute_path \" " 1>&2
387
394
fi
395
+
388
396
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
390
403
done
391
404
return 0
392
405
}
You can’t perform that action at this time.
0 commit comments