Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions generate_client.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
#!/bin/bash

# Function to handle errors
echo_error() {
echo "Error: $1" >&2
}

# Check if Docker is installed
docker --version >/dev/null 2>&1 || { echo_error "Docker is not installed. Please install Docker and try again."; exit 1; }

# Run the OpenAPI Generator
if ! docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
-i https://arcane.engineer/api/openapi.yaml \
-g python \
--additional-properties generateSourceCodeOnly=true,projectName=arcane-engine,packageName=arcane \
-o /local
-o /local; then
echo_error "Failed to generate client code. Please check the OpenAPI specification and try again."
exit 1
fi

# Success message
echo "Client code generated successfully."