commit 38907b133b3fc6962bbd47600cde9dfd21477ccc
parent a64ff5190957e68a48b4eeed6137580db6f9d8eb
Author: Daniel Moch <daniel@danielmoch.com>
Date: Sat, 15 Sep 2018 23:57:54 -0400
Fixes to make.bat
Diffstat:
1 file changed, 19 insertions(+), 18 deletions(-)
diff --git a/{{cookiecutter.project_slug}}/make.bat b/{{cookiecutter.project_slug}}/make.bat
@@ -1,4 +1,5 @@
@echo off
+setlocal ENABLEDELAYEDEXPANSION
set BROWSER_PYSCRIPT=import os, webbrowser, sys^
try:^
@@ -34,57 +35,57 @@ set PIP=pip
set PIPENV=pipenv
set PIPRUN=%PIPENV% run
set PIPINST=%PIPENV% --bare install --dev --skip-lock
-set BROWSER=%PYTHON% -c %BROWSER_PYSCRIPT%
+set BROWSER=%PYTHON% -c !BROWSER_PYSCRIPT!
-if "%1" == "help" (
- %PYTHON% -c "%PRINT_HELP_PYSCRIPT%" < %~f0
+if "%1"=="help" (
+ %PYTHON% -c "!PRINT_HELP_PYSCRIPT!" < %~f0
goto :end
)
-if "%1" == "clean" (
+if "%1"=="clean" (
call :cleanbuild
call :cleanpyc
call :cleantest
goto :end
)
-if "%1" == "cleanbuild" (
+if "%1"=="cleanbuild" (
call :cleanbuild
goto :end
)
-if "%1" == "cleanpyc" (
+if "%1"=="cleanpyc" (
call :cleanpyc
goto :end
)
-if "%1" == "cleantest" (
+if "%1"=="cleantest" (
call :cleantest
goto :end
)
-if "%1" == "lint" (
+if "%1"=="lint" (
@echo on
%PIPRUN% pylint {{ cookiecutter.project_slug }} tests --disable=parse-error
@echo off
goto :end
)
-if "%1" == "test" (
+if "%1"=="test" (
@echo on
%PIPRUN% python -m pytest
@echo off
goto :end
)
-if "%1" == "test-all" (
+if "%1"=="test-all" (
@echo on
%PIPRUN% tox
@echo off
goto :end
)
-if "%1" == "test-install" (
+if "%1"=="test-install" (
@echo on
%PYTHON% -m %PIP% install --upgrade pip pipenv
%PIPINST%
@@ -92,14 +93,14 @@ if "%1" == "test-install" (
goto :end
)
-if "%1" == "coverage" (
+if "%1"=="coverage" (
@echo on
%PIPRUN% python -m pytest --cov={{ cookiecutter.project_slug }}
@echo off
goto :end
)
-if "%1" == "coverage-html" (
+if "%1"=="coverage-html" (
@echo on
%PIPRUN% python -m pytest --cov={{ cookiecutter.project_slug }}
%PIPRUN% coverage html
@@ -108,7 +109,7 @@ if "%1" == "coverage-html" (
goto :end
)
-if "%1" == "release" (
+if "%1"=="release" (
@echo on
%PIPRUN% flit build
dir dist
@@ -117,7 +118,7 @@ if "%1" == "release" (
goto :end
)
-if "%1" == "dist" (
+if "%1"=="dist" (
@echo on
%PIPRUN% flit build
dir dist
@@ -125,21 +126,21 @@ if "%1" == "dist" (
goto :end
)
-if "%1" == "install" (
+if "%1"=="install" (
@echo on
%PIPRUN% flit install --deps=none
@echo off
goto :end
)
-if "%1" == "run" (
+if "%1"=="run" (
@echo on
%PIPRUN% python -m {{ cookiecutter.project_slug }} %cmd%
@echo off
goto :end
)
-if "%1" == "debug" (
+if "%1"=="debug" (
@echo on
%PIPRUN% flit install --deps=none
%PIPRUN% pudb3 {{ cookiecutter.project_slug }} %cmd%