From 545126451a6b18065172de9cbb43edc700942e7e Mon Sep 17 00:00:00 2001 From: Charlie Lamb Date: Fri, 17 Apr 2026 16:38:42 +0100 Subject: [PATCH] chore: remove target args --- scripts/setup/setupS3Admin.ts | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/scripts/setup/setupS3Admin.ts b/scripts/setup/setupS3Admin.ts index 131af2042..d92a868ab 100644 --- a/scripts/setup/setupS3Admin.ts +++ b/scripts/setup/setupS3Admin.ts @@ -10,26 +10,14 @@ import { S3Client, } from "@aws-sdk/client-s3"; import { - ADMIN_REQUEST_BLOCK_CONFIG_KEY as REQUEST_BLOCK_CONFIG_KEY, getAdminS3Config, + ADMIN_REQUEST_BLOCK_CONFIG_KEY as REQUEST_BLOCK_CONFIG_KEY, } from "@server/external/aws/s3/adminS3Config.js"; + const DEFAULT_REQUEST_BLOCK_CONFIG = { orgs: {}, }; -const getTargetFromArgs = () => { - const hasDevFlag = process.argv.includes("--dev"); - const hasProdFlag = process.argv.includes("--prod"); - - if (hasDevFlag && hasProdFlag) { - throw new Error("Use either --dev or --prod, not both"); - } - - if (hasDevFlag) return "dev" as const; - if (hasProdFlag) return "prod" as const; - return undefined; -}; - const createS3Client = ({ region }: { region: string }) => { return new S3Client({ region }); }; @@ -178,12 +166,11 @@ const ensureRequestBlockConfigExists = async ({ }; const main = async () => { - const target = getTargetFromArgs(); - const { bucket, region } = getAdminS3Config({ target }); + const { bucket, region } = getAdminS3Config(); const s3Client = createS3Client({ region }); console.log( - `Initializing S3 admin config for ${target || process.env.NODE_ENV || "default"} -> s3://${bucket}/${REQUEST_BLOCK_CONFIG_KEY}`, + `Initializing S3 admin config for ${process.env.NODE_ENV || "default"} -> s3://${bucket}/${REQUEST_BLOCK_CONFIG_KEY}`, ); await ensureBucketExists({