From 6ca2681c96c3e0356e4dbc5eaa231a130f0fe068 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 12 Sep 2022 07:48:12 -0400 Subject: [PATCH] env var fixes --- scripts/inventory.ts | 4 ++-- scripts/repair.ts | 5 +++-- scripts/upload-sync.ts | 4 ++-- scripts/upload.ts | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/inventory.ts b/scripts/inventory.ts index f0ac55df..dfc47d6b 100755 --- a/scripts/inventory.ts +++ b/scripts/inventory.ts @@ -5,7 +5,7 @@ args: - deno - run - --allow-net - - --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,S3_BUCKET + - --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,S3_BUCKET,AWS_S3 - --import-map={{ srcroot }}/import-map.json ---*/ @@ -20,7 +20,7 @@ const s3 = new S3({ region: "us-east-1", }); -const bucket = s3.getBucket(Deno.env.get("S3_BUCKET")!); +const bucket = s3.getBucket(Deno.env.get("AWS_S3") ?? Deno.env.get("S3_BUCKET")!); const inventory: Inventory = {} const flat = [] diff --git a/scripts/repair.ts b/scripts/repair.ts index b8e538da..5a8335b9 100755 --- a/scripts/repair.ts +++ b/scripts/repair.ts @@ -6,6 +6,7 @@ args: - deno - run - --allow-net + - --allow-env=TEA_PREFIX,VERBOSE,DEBUG,MAGIC,GITHUB_ACTIONS,JSON - --allow-read={{ tea.prefix }} - --allow-write={{ tea.prefix }} - --allow-run # uses `/bin/ln` @@ -14,9 +15,9 @@ args: */ import repairLinks from "prefab/repair-links.ts" -import { print } from "utils" +import useFlags from "hooks/useFlags.ts" -print("this because otherwise console.verbose is not defined lol") +useFlags() for (const project of Deno.args) { await repairLinks(project) diff --git a/scripts/upload-sync.ts b/scripts/upload-sync.ts index 71596005..72eddb60 100755 --- a/scripts/upload-sync.ts +++ b/scripts/upload-sync.ts @@ -6,7 +6,7 @@ args: - run - --allow-net - --allow-read={{ tea.prefix }}/tea.xyz/var/www - - --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,S3_BUCKET + - --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,S3_BUCKET,AWS_S3 - --import-map={{ srcroot }}/import-map.json ---*/ @@ -22,7 +22,7 @@ const s3 = new S3({ region: "us-east-1", }); -const bucket = s3.getBucket(Deno.env.get("S3_BUCKET")!); +const bucket = s3.getBucket(Deno.env.get("AWS_S3") ?? Deno.env.get("S3_BUCKET")!); for (const pkg of await useCache().ls()) { const key = useCache().s3Key(pkg) diff --git a/scripts/upload.ts b/scripts/upload.ts index c850b270..bc373cfb 100755 --- a/scripts/upload.ts +++ b/scripts/upload.ts @@ -26,7 +26,7 @@ const s3 = new S3({ region: "us-east-1", }) -const bucket = s3.getBucket(Deno.env.get("AWS_S3")!) +const bucket = s3.getBucket(Deno.env.get("AWS_S3") ?? Deno.env.get("S3_BUCKET")!) const encode = (() => { const e = new TextEncoder(); return e.encode.bind(e) })()