2
0

stainless 951 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. set -e
  3. # Parse command line arguments
  4. DEV_MODE=false
  5. for arg in "$@"; do
  6. if [ "$arg" = "--dev" ]; then
  7. DEV_MODE=true
  8. fi
  9. done
  10. echo "Starting opencode server on port 4096..."
  11. bun run ./packages/opencode/src/index.ts serve --port 4096 &
  12. SERVER_PID=$!
  13. echo "Waiting for server to start..."
  14. sleep 3
  15. echo "Fetching OpenAPI spec from http://127.0.0.1:4096/doc..."
  16. curl -s http://127.0.0.1:4096/doc > openapi.json
  17. echo "Stopping server..."
  18. kill $SERVER_PID
  19. echo "Running stl builds create..."
  20. stl builds create --branch dev --pull --allow-empty --targets go
  21. echo "Cleaning up..."
  22. rm -rf packages/tui/sdk
  23. mv opencode-go/ packages/tui/sdk/
  24. rm -rf packages/tui/sdk/.git
  25. # Only run production build if not in dev mode
  26. if [ "$DEV_MODE" = false ]; then
  27. echo "Kicking off production build..."
  28. stl builds create --branch main --wait=false
  29. else
  30. echo "Skipping production build (--dev flag detected)"
  31. fi
  32. echo "Done!"