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() {
10
10
source " $test_dir /../virtualenvwrapper.sh"
11
11
mkvirtualenv test1 > /dev/null 2>&1
12
12
mkvirtualenv test2 > /dev/null 2>&1
13
+ mkvirtualenv " env with space " > /dev/null 2>&1
13
14
deactivate
14
15
}
15
16
@@ -28,6 +29,8 @@ tearDown () {
28
29
test_allvirtualenv_all () {
29
30
assertTrue " Did not find test1" " allvirtualenv pwd | grep -q 'test1$'"
30
31
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 '"
31
34
}
32
35
33
36
test_allvirtualenv_spaces () {
Original file line number Diff line number Diff line change @@ -75,5 +75,11 @@ test_lsvirtualenv_space_in_workon_home () {
75
75
WORKON_HOME=" $old_home "
76
76
}
77
77
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
+
78
84
79
85
. " $test_dir /shunit2"
Original file line number Diff line number Diff line change @@ -569,8 +569,9 @@ function virtualenvwrapper_show_workon_options {
569
569
# 5. Eliminate any lines with * on them because that means there
570
570
# were no envs.
571
571
(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" \
574
575
| (unset GREP_OPTIONS; command \e grep -v ' ^\*$' ) 2> /dev/null
575
576
}
576
577
@@ -1292,6 +1293,7 @@ function allvirtualenv {
1292
1293
virtualenvwrapper_verify_workon_home || return 1
1293
1294
typeset d
1294
1295
1296
+ IFS=' '
1295
1297
virtualenvwrapper_show_workon_options | while read d
1296
1298
do
1297
1299
[ ! -d " $WORKON_HOME /$d " ] && continue
@@ -1304,6 +1306,7 @@ function allvirtualenv {
1304
1306
" $@ " )
1305
1307
echo
1306
1308
done
1309
+ unset IFS
1307
1310
}
1308
1311
1309
1312
# :help:virtualenvwrapper: show this help message
You can’t perform that action at this time.
0 commit comments