Files
go-gin-api/scripts/gormgen.bat
T
anserme 6af343d0b1 bugs fix
修复win下环境变量错误使用的问题
2021-07-16 12:57:20 +08:00

51 lines
705 B
Batchfile

@echo off
chcp 65001
echo.
echo Regenerating file
echo.
go run -v .\cmd\mysqlmd\main.go -addr %1 -user %2 -pass %3 -name %4 -tables %5
if %errorlevel% == 1 (
echo.
echo failed!!!
exit 1
)
echo.
echo create curd code :
echo.
go build -o gormgen .\cmd\gormgen\main.go
if %errorlevel% == 1 (
echo.
echo failed!!!
exit 1
)
if exist %GOPATH%\bin (
move gormgen %GOPATH%\bin\gormgen.exe
) else (
md %GOPATH%\bin
move gormgen %GOPATH%\bin\gormgen.exe
)
if %errorlevel% == 1 (
echo.
echo failed!!!
exit 1
)
go generate .\...
if %errorlevel% == 1 (
echo.
echo failed!!!
exit 1
)
echo.
echo Formatting code
echo.
go run -v .\cmd\mfmt\main.go
if %errorlevel% == 1 (
echo.
echo failed!!!
exit 1
)
echo.
echo Done.