Consolidated ASP Classic MVC framework from best components
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

44 lignes
1.6KB

  1. @echo off
  2. rem Runs a code generator inside the running "axonasp" container with the AxonASP CLI.
  3. rem
  4. rem scripts\gen.cmd migration <migration_name>
  5. rem scripts\gen.cmd controller <Name> Index "Show(id)" NewForm Create "Edit(id)" "Update(id)" "Delete(id)"
  6. rem scripts\gen.cmd repo /table:<Table> /pk:<PrimaryKey>
  7. rem scripts\gen.cmd api /table:<Table> /pk:<PrimaryKey> (repo + JSON API controller, routes, OpenAPI spec)
  8. rem
  9. rem Controller actions are separate arguments (quote the ones with parentheses).
  10. setlocal
  11. set "GEN=%~1"
  12. set "SCRIPT="
  13. if "%GEN%"=="migration" set "SCRIPT=generateMigration.vbs"
  14. if "%GEN%"=="controller" set "SCRIPT=generateController.vbs"
  15. if "%GEN%"=="repo" set "SCRIPT=GenerateRepo.vbs"
  16. if "%GEN%"=="api" set "SCRIPT=GenerateRepo.vbs"
  17. if not defined SCRIPT goto usage
  18. set "A1=%~2"
  19. set "A2=%~3"
  20. if not "%GEN%"=="controller" goto run
  21. set "A2="
  22. shift
  23. shift
  24. :collect
  25. set "CUR=%~1"
  26. if not defined CUR goto run
  27. if defined A2 goto join
  28. set "A2=%CUR%"
  29. goto next
  30. :join
  31. set "A2=%A2%;%CUR%"
  32. :next
  33. shift
  34. goto collect
  35. :run
  36. docker exec -e SERVER_WEB_ROOT=/opt/axonasp/site -e "ARG1=%A1%" -e "ARG2=%A2%" axonasp ./axonasp-cli -m vbscript -r /opt/axonasp/site/scripts/%SCRIPT%
  37. if not "%GEN%"=="api" exit /b %errorlevel%
  38. rem api: the repo/POBO were generated above, now the controller, routes and spec
  39. docker exec -e SERVER_WEB_ROOT=/opt/axonasp/site -e "ARG1=%A1%" -e "ARG2=%A2%" axonasp ./axonasp-cli -m vbscript -r /opt/axonasp/site/scripts/GenerateApi.vbs
  40. exit /b %errorlevel%
  41. :usage
  42. echo Usage: scripts\gen.cmd (migration^|controller^|repo^|api) args...
  43. exit /b 1

Powered by TurnKey Linux.