build.sh 1.1 KB

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. currPath=$(pwd)
  3. parentPath=$(dirname "$currPath")
  4. apiServicesPath=${parentPath}/src/api-services/
  5. echo "================================ 生成目录 ${apiServicesPath} ================================"
  6. # 判断目录是否存在
  7. if test -d "$apiServicesPath"; then
  8. echo "================================ 删除目录 api-services ================================"
  9. rm -rf "${apiServicesPath}"
  10. fi
  11. echo "================================ 开始生成 api-services ================================"
  12. java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%20Groups/swagger.json -l typescript-axios -o "${apiServicesPath}"
  13. rm -rf "${apiServicesPath}".swagger-codegen
  14. rm -f "${apiServicesPath}".gitignore
  15. rm -f "${apiServicesPath}".npmignore
  16. rm -f "${apiServicesPath}".swagger-codegen-ignore
  17. rm -f "${apiServicesPath}"git_push.sh
  18. rm -f "${apiServicesPath}"package.json
  19. rm -f "${apiServicesPath}"README.md
  20. rm -f "${apiServicesPath}"tsconfig.json
  21. echo "================================ 生成结束 ================================"