File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed
Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ oneTimeSetUp() {
1010 source " $test_dir /../virtualenvwrapper.sh"
1111 mkvirtualenv test1 > /dev/null 2>&1
1212 mkvirtualenv test2 > /dev/null 2>&1
13+ mkvirtualenv " env with space " > /dev/null 2>&1
1314 deactivate
1415}
1516
@@ -28,6 +29,8 @@ tearDown () {
2829test_allvirtualenv_all () {
2930 assertTrue " Did not find test1" " allvirtualenv pwd | grep -q 'test1$'"
3031 assertTrue " Did not find test2" " allvirtualenv pwd | grep -q 'test2$'"
32+ allvirtualenv pwd
33+ assertTrue " Did not find ' env with space '" " allvirtualenv pwd | grep -q ' env with space '"
3134}
3235
3336test_allvirtualenv_spaces () {
Original file line number Diff line number Diff line change @@ -75,5 +75,11 @@ test_lsvirtualenv_space_in_workon_home () {
7575 WORKON_HOME=" $old_home "
7676}
7777
78+ test_lsvirtualenv_space_in_env_name () {
79+ mkvirtualenv " env with space "
80+ lsvirtualenv -b > " $WORKON_HOME /output" 2>&1
81+ assertTrue " Did not see expected message in \" $output \" " " cat \" $WORKON_HOME /output\" | grep -q ' env with space '"
82+ }
83+
7884
7985. " $test_dir /shunit2"
Original file line number Diff line number Diff line change @@ -569,8 +569,9 @@ function virtualenvwrapper_show_workon_options {
569569 # 5. Eliminate any lines with * on them because that means there
570570 # were no envs.
571571 (virtualenvwrapper_cd " $WORKON_HOME " && echo * /$VIRTUALENVWRAPPER_ENV_BIN_DIR /activate) 2> /dev/null \
572- | command \s ed " s|/$VIRTUALENVWRAPPER_ENV_BIN_DIR /activate||g" \
573- | command \f mt -w 1 \
572+ | command \t r " \n" " " \
573+ | command \s ed " s|/$VIRTUALENVWRAPPER_ENV_BIN_DIR /activate |/|g" \
574+ | command \t r " /" " \n" \
574575 | (unset GREP_OPTIONS; command \e grep -v ' ^\*$' ) 2> /dev/null
575576}
576577
@@ -1292,6 +1293,7 @@ function allvirtualenv {
12921293 virtualenvwrapper_verify_workon_home || return 1
12931294 typeset d
12941295
1296+ IFS=' '
12951297 virtualenvwrapper_show_workon_options | while read d
12961298 do
12971299 [ ! -d " $WORKON_HOME /$d " ] && continue
@@ -1304,6 +1306,7 @@ function allvirtualenv {
13041306 " $@ " )
13051307 echo
13061308 done
1309+ unset IFS
13071310}
13081311
13091312# :help:virtualenvwrapper: show this help message
You can’t perform that action at this time.
0 commit comments