File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ test_cprelocatablevirtualenv () {
4949 assertSame " $VIRTUAL_ENV " " $( pwd) "
5050}
5151
52+ test_cp_notexists () {
53+ out=" $( cpvirtualenv virtualenvthatdoesntexist foo) "
54+ assertSame " $out " " virtualenvthatdoesntexist virtualenv doesn't exist"
55+ }
5256
5357. " $test_dir /shunit2"
5458
Original file line number Diff line number Diff line change @@ -438,14 +438,20 @@ function cpvirtualenv() {
438438 echo " Please specify target virtualenv"
439439 return 1
440440 fi
441- if [ echo " $WORKON_HOME " | grep -e " /$" ]
441+ if echo " $WORKON_HOME " | grep -e " /$"
442442 then
443443 env_home=" $WORKON_HOME "
444444 else
445445 env_home=" $WORKON_HOME /"
446446 fi
447447 source_env=" $env_home$env_name "
448448 target_env=" $env_home$new_env "
449+
450+ if [ ! -e " $source_env " ]
451+ then
452+ echo " $env_name virtualenv doesn't exist"
453+ return 1
454+ fi
449455
450456 cp -r " $source_env " " $target_env "
451457 for script in $( ls $target_env /bin/* )
You can’t perform that action at this time.
0 commit comments