diff --git a/package.json b/package.json index 22284dde..c42132eb 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "dev": "astro dev", "start": "astro dev", "build": "astro build", + "postbuild": "sh scripts/download-install-sh.sh", "preview": "astro preview", "astro": "astro", "validate": "node scripts/validate.js --all", diff --git a/public/.ic-assets.json5 b/public/.ic-assets.json5 index a146ecbe..4c4e9285 100644 --- a/public/.ic-assets.json5 +++ b/public/.ic-assets.json5 @@ -35,6 +35,15 @@ "Content-Type": "text/plain; charset=utf-8" } }, + { + // Shell scripts served as plain text so curl | sh works correctly. + // install.sh is fetched fresh on every build so no long-lived cache. + "match": "**/*.sh", + "headers": { + "Content-Type": "text/plain; charset=utf-8", + "Cache-Control": "public, max-age=0, must-revalidate" + } + }, { // Markdown endpoints and llms.txt — short cache so updates are visible quickly "match": "**/*.{md,txt}", diff --git a/scripts/download-install-sh.sh b/scripts/download-install-sh.sh new file mode 100755 index 00000000..165b7e77 --- /dev/null +++ b/scripts/download-install-sh.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# Downloads the ICP SDK installer into the build output so it is served +# at /install.sh — mirroring the portal's download-redirected-files.sh pattern. +curl -sf https://raw.githubusercontent.com/dfinity/sdk/public-manifest/install.sh \ + -o dist/install.sh \ + || echo "Warning: could not download install.sh — file will not be served"