From a4b94441d5d665cd773e2129b64e909d855dc4d7 Mon Sep 17 00:00:00 2001 From: Rico Hermans Date: Fri, 7 Jul 2023 12:33:22 +0200 Subject: [PATCH] chore: download noctilucent instead of building it (#26258) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/aws-cdk/.gitignore | 1 + packages/aws-cdk/.npmignore | 1 + packages/aws-cdk/generate.sh | 11 ++++++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/aws-cdk/.gitignore b/packages/aws-cdk/.gitignore index 778ab4bcae6a9..ba79b3b0cb5c5 100644 --- a/packages/aws-cdk/.gitignore +++ b/packages/aws-cdk/.gitignore @@ -42,3 +42,4 @@ lib/vendor/noctilucent/* .DS_Store junit.xml +tmp/ diff --git a/packages/aws-cdk/.npmignore b/packages/aws-cdk/.npmignore index a5f61214eee06..c59a8edc18921 100644 --- a/packages/aws-cdk/.npmignore +++ b/packages/aws-cdk/.npmignore @@ -31,3 +31,4 @@ junit.xml generate.sh lib/vendor/noctilucent/Dockerfile +tmp/ diff --git a/packages/aws-cdk/generate.sh b/packages/aws-cdk/generate.sh index 65655572bf459..f27a9e2845c7f 100755 --- a/packages/aws-cdk/generate.sh +++ b/packages/aws-cdk/generate.sh @@ -18,10 +18,15 @@ HERE # Download noctilucent wasm-pack build NOCTILUCENT_VERSION=0.1.2 PACK_URL=https://github.com/iph/noctilucent/releases/download/v${NOCTILUCENT_VERSION}/wasm-pack.zip +zipfile=$PWD/tmp/noctilucent-wasm-${NOCTILUCENT_VERSION}.zip outdir=lib/vendor/noctilucent -mkdir -p $outdir -(cd $outdir && curl -sSfLo wasm-pack.zip "$PACK_URL" && unzip -o wasm-pack.zip) +mkdir -p tmp +if [[ ! -f "$zipfile" ]]; then + curl -sSfLo "$zipfile" "$PACK_URL" +fi + +(cd $outdir && unzip -qo $zipfile) # Don't need these files -rm $outdir/{.gitignore,README.md,package.json,wasm-pack.zip} +rm -f $outdir/{.gitignore,README.md,package.json}