env var fixes

This commit is contained in:
Max Howell 2022-09-12 07:48:12 -04:00
parent 6a82b73ef6
commit 6ca2681c96
4 changed files with 8 additions and 7 deletions

View file

@ -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 = []

View file

@ -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)

View file

@ -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)

View file

@ -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) })()