Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Update api spec script
Jakub Novak365ef328a509
diff --git a/Makefile b/Makefilenew file mode 100644index 000000000..ee84c9828--- /dev/null+++ b/Makefile@@ -0,0 +1,4 @@+update-api-spec:+ @echo "Updating API spec"+ @./scripts/update-api-spec.sh+ @echo "Done"diff --git a/scripts/update-api-spec.sh b/scripts/update-api-spec.shnew file mode 100755index 000000000..100a87ad5--- /dev/null+++ b/scripts/update-api-spec.sh@@ -0,0 +1,32 @@+#!/bin/sh++set -eu++# This script is used to update the spec/openapi.yml file from the api repo++# Check if the remote is set+if [ -z "$(git remote get-url api)" ]; then+ git remote add api [email protected]:e2b-dev/api.git+fi++# Get the current branch+BRANCH=$(git rev-parse --abbrev-ref HEAD)++# Fetch the latest changes+git fetch api++# Checkout the latest changes+git checkout api/main -B temp_api_branch++# Create a temporary branch to store the spec+git subtree split --prefix=spec -b temp_spec_branch++# Checkout the branch+git checkout "$BRANCH"++# Merge the changes+git subtree merge --prefix=spec temp_spec_branch --squash++# Remove the temporary branch+git branch -D temp_spec_branch+git branch -D temp_api_branch