File tree Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -489,7 +489,10 @@ PROJECT_HOME.
489
489
490
490
Syntax::
491
491
492
- mkproject [-t template] [virtualenv_options] ENVNAME
492
+ mkproject [-f|--force] [-t template] [virtualenv_options] ENVNAME
493
+
494
+ -f, --force Create the virtualenv even if the project directory
495
+ already exists
493
496
494
497
The template option may be repeated to have several templates used to
495
498
create a new project. The templates are applied in the order named on
Original file line number Diff line number Diff line change 24
24
25
25
- Sphinx
26
26
- docutils
27
+ - sphinxcontrib-bitbucket
27
28
28
29
Once all of the tools are installed into a virtualenv using
29
30
pip, run ``make html `` to generate the HTML version of the
Original file line number Diff line number Diff line change @@ -66,6 +66,8 @@ test_project_exists () {
66
66
mkproject myproject4 > /dev/null 2>&1
67
67
output=` mkproject myproject4 2>&1 `
68
68
assertTrue " Did not see expected message 'already exists' in: $output " " echo $output | grep 'already exists'"
69
+ output=` mkproject -f myproject4 2>&1 `
70
+ assertFalse " Saw unexpected message 'already exists' in: $output " " echo $output | grep 'already exists'"
69
71
}
70
72
71
73
test_same_workon_and_project_home () {
Original file line number Diff line number Diff line change @@ -974,14 +974,17 @@ function setvirtualenvproject {
974
974
975
975
# Show help for mkproject
976
976
function virtualenvwrapper_mkproject_help {
977
- echo " Usage: mkproject [-t template] [virtualenv options] project_name"
978
- echo " "
977
+ echo " Usage: mkproject [-f|--force] [-t template] [virtualenv options] project_name"
978
+ echo
979
+ echo " -f, --force Create the virtualenv even if the project directory"
980
+ echo " already exists"
981
+ echo
979
982
echo " Multiple templates may be selected. They are applied in the order"
980
983
echo " specified on the command line."
981
- echo ;
984
+ echo
982
985
echo " mkvirtualenv help:"
983
986
echo
984
- mkvirtualenv -h;
987
+ mkvirtualenv -h
985
988
echo
986
989
echo " Available project templates:"
987
990
echo
@@ -996,9 +999,11 @@ function mkproject {
996
999
typeset tst
997
1000
typeset a
998
1001
typeset t
1002
+ typeset force
999
1003
typeset templates
1000
1004
1001
1005
in_args=( " $@ " )
1006
+ force=0
1002
1007
1003
1008
if [ -n " $ZSH_VERSION " ]
1004
1009
then
@@ -1015,6 +1020,8 @@ function mkproject {
1015
1020
-h|--help)
1016
1021
virtualenvwrapper_mkproject_help;
1017
1022
return ;;
1023
+ -f|--force)
1024
+ force=1;;
1018
1025
-t)
1019
1026
i=$(( $i + 1 )) ;
1020
1027
templates=" $templates ${in_args[$i]} " ;;
@@ -1038,7 +1045,7 @@ function mkproject {
1038
1045
eval " typeset envname=\$ $# "
1039
1046
virtualenvwrapper_verify_project_home || return 1
1040
1047
1041
- if [ -d " $PROJECT_HOME /$envname " ]
1048
+ if [ -d " $PROJECT_HOME /$envname " -a $force -eq 0 ]
1042
1049
then
1043
1050
echo " Project $envname already exists." >&2
1044
1051
return 1
You can’t perform that action at this time.
0 commit comments