From 8b3575dd23ce76733845567c91bb59e7bee04276 Mon Sep 17 00:00:00 2001 From: Martin Helmich Date: Mon, 26 Feb 2024 12:20:31 +0100 Subject: [PATCH 1/2] When downloading API spec, follow redirects and fail on error --- packages/mittwald/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mittwald/package.json b/packages/mittwald/package.json index caaa93b5..4c516351 100644 --- a/packages/mittwald/package.json +++ b/packages/mittwald/package.json @@ -34,7 +34,7 @@ "build": "run build:clean && run tsc", "build:clean": "run rimraf dist", "build:client": "run acg generate --name MittwaldAPIV2 spec/openapi.json src/generated/v2 --optionalHeader x-access-token", - "build:fetch-openapi": "curl --silent https://api.mittwald.de/openapi | spec/transform-openapi.sh > spec/openapi.json", + "build:fetch-openapi": "curl --location --fail --silent https://api.mittwald.de/openapi | spec/transform-openapi.sh > spec/openapi.json", "build:write-version-file": "run tsx dev/writeVersion.ts", "format": "run prettier --write '**/*.{ts,tsx,yaml,yml,json,md,mdx,js}'", "lint": "run eslint .", From f2a482f8223b400d2262747a3b3c63fa74385e43 Mon Sep 17 00:00:00 2001 From: Martin Helmich Date: Mon, 26 Feb 2024 12:32:06 +0100 Subject: [PATCH 2/2] Run update script with -o pipefail --- packages/mittwald/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mittwald/package.json b/packages/mittwald/package.json index 4c516351..a18e79ce 100644 --- a/packages/mittwald/package.json +++ b/packages/mittwald/package.json @@ -34,7 +34,7 @@ "build": "run build:clean && run tsc", "build:clean": "run rimraf dist", "build:client": "run acg generate --name MittwaldAPIV2 spec/openapi.json src/generated/v2 --optionalHeader x-access-token", - "build:fetch-openapi": "curl --location --fail --silent https://api.mittwald.de/openapi | spec/transform-openapi.sh > spec/openapi.json", + "build:fetch-openapi": "bash -e -o pipefail -c 'curl --location --fail --silent https://api.mittwald.de/openapi | spec/transform-openapi.sh > spec/openapi.json'", "build:write-version-file": "run tsx dev/writeVersion.ts", "format": "run prettier --write '**/*.{ts,tsx,yaml,yml,json,md,mdx,js}'", "lint": "run eslint .",