gormgen.bat 705 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. @echo off
  2. chcp 65001
  3. echo.
  4. echo Regenerating file
  5. echo.
  6. go run -v .\cmd\mysqlmd\main.go -addr %1 -user %2 -pass %3 -name %4 -tables %5
  7. if %errorlevel% == 1 (
  8. echo.
  9. echo failed!!!
  10. exit 1
  11. )
  12. echo.
  13. echo create curd code :
  14. echo.
  15. go build -o gormgen .\cmd\gormgen\main.go
  16. if %errorlevel% == 1 (
  17. echo.
  18. echo failed!!!
  19. exit 1
  20. )
  21. if exist %GOPATH%\bin (
  22. move gormgen %GOPATH%\bin\gormgen.exe
  23. ) else (
  24. md %GOPATH%\bin
  25. move gormgen %GOPATH%\bin\gormgen.exe
  26. )
  27. if %errorlevel% == 1 (
  28. echo.
  29. echo failed!!!
  30. exit 1
  31. )
  32. go generate .\...
  33. if %errorlevel% == 1 (
  34. echo.
  35. echo failed!!!
  36. exit 1
  37. )
  38. echo.
  39. echo Formatting code
  40. echo.
  41. go run -v .\cmd\mfmt\main.go
  42. if %errorlevel% == 1 (
  43. echo.
  44. echo failed!!!
  45. exit 1
  46. )
  47. echo.
  48. echo Done.