Commit

Fixes to make.bat
Daniel Moch committed 5 years ago (Tree)

Diffstat

 {{cookiecutter.project_slug}}/make.bat | 37 ++++++++++++++-------------

{{cookiecutter.project_slug}}/make.bat

1 1 @echo off
2 +setlocal ENABLEDELAYEDEXPANSION
2 3 set BROWSER_PYSCRIPT=import os, webbrowser, sys^
3 4
4 5 try:^
. . .
34 35 set PIPENV=pipenv
35 36 set PIPRUN=%PIPENV% run
36 37 set PIPINST=%PIPENV% --bare install --dev --skip-lock
37 -set BROWSER=%PYTHON% -c %BROWSER_PYSCRIPT%
38 +set BROWSER=%PYTHON% -c !BROWSER_PYSCRIPT!
38 39
39 -if "%1" == "help" (
40 - %PYTHON% -c "%PRINT_HELP_PYSCRIPT%" < %~f0
40 +if "%1"=="help" (
41 + %PYTHON% -c "!PRINT_HELP_PYSCRIPT!" < %~f0
41 42 goto :end
42 43 )
43 44
44 -if "%1" == "clean" (
45 +if "%1"=="clean" (
45 46 call :cleanbuild
46 47 call :cleanpyc
47 48 call :cleantest
48 49 goto :end
49 50 )
50 51
51 -if "%1" == "cleanbuild" (
52 +if "%1"=="cleanbuild" (
52 53 call :cleanbuild
53 54 goto :end
54 55 )
55 56
56 -if "%1" == "cleanpyc" (
57 +if "%1"=="cleanpyc" (
57 58 call :cleanpyc
58 59 goto :end
59 60 )
60 61
61 -if "%1" == "cleantest" (
62 +if "%1"=="cleantest" (
62 63 call :cleantest
63 64 goto :end
64 65 )
65 66
66 -if "%1" == "lint" (
67 +if "%1"=="lint" (
67 68 @echo on
68 69 %PIPRUN% pylint {{ cookiecutter.project_slug }} tests --disable=parse-error
69 70 @echo off
70 71 goto :end
71 72 )
72 73
73 -if "%1" == "test" (
74 +if "%1"=="test" (
74 75 @echo on
75 76 %PIPRUN% python -m pytest
76 77 @echo off
77 78 goto :end
78 79 )
79 80
80 -if "%1" == "test-all" (
81 +if "%1"=="test-all" (
81 82 @echo on
82 83 %PIPRUN% tox
83 84 @echo off
84 85 goto :end
85 86 )
86 87
87 -if "%1" == "test-install" (
88 +if "%1"=="test-install" (
88 89 @echo on
89 90 %PYTHON% -m %PIP% install --upgrade pip pipenv
90 91 %PIPINST%
. . .
92 93 goto :end
93 94 )
94 95
95 -if "%1" == "coverage" (
96 +if "%1"=="coverage" (
96 97 @echo on
97 98 %PIPRUN% python -m pytest --cov={{ cookiecutter.project_slug }}
98 99 @echo off
99 100 goto :end
100 101 )
101 102
102 -if "%1" == "coverage-html" (
103 +if "%1"=="coverage-html" (
103 104 @echo on
104 105 %PIPRUN% python -m pytest --cov={{ cookiecutter.project_slug }}
105 106 %PIPRUN% coverage html
. . .
108 109 goto :end
109 110 )
110 111
111 -if "%1" == "release" (
112 +if "%1"=="release" (
112 113 @echo on
113 114 %PIPRUN% flit build
114 115 dir dist
. . .
117 118 goto :end
118 119 )
119 120
120 -if "%1" == "dist" (
121 +if "%1"=="dist" (
121 122 @echo on
122 123 %PIPRUN% flit build
123 124 dir dist
. . .
125 126 goto :end
126 127 )
127 128
128 -if "%1" == "install" (
129 +if "%1"=="install" (
129 130 @echo on
130 131 %PIPRUN% flit install --deps=none
131 132 @echo off
132 133 goto :end
133 134 )
134 135
135 -if "%1" == "run" (
136 +if "%1"=="run" (
136 137 @echo on
137 138 %PIPRUN% python -m {{ cookiecutter.project_slug }} %cmd%
138 139 @echo off
139 140 goto :end
140 141 )
141 142
142 -if "%1" == "debug" (
143 +if "%1"=="debug" (
143 144 @echo on
144 145 %PIPRUN% flit install --deps=none
145 146 %PIPRUN% pudb3 {{ cookiecutter.project_slug }} %cmd%