Skip to content

Commit

Permalink
run the lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankcorn committed Jan 7, 2025
1 parent 2611ad4 commit 5de1ee5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
4 changes: 1 addition & 3 deletions packages/wrangler/src/__tests__/pages/secret.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,7 @@ describe("wrangler pages secret", () => {
text: "secret-3",
},
]);
await runWrangler(
"pages secret bulk .env --project some-project-name"
);
await runWrangler("pages secret bulk .env --project some-project-name");

expect(std.out).toMatchInlineSnapshot(`
"🌀 Creating the secrets for the Pages project \\"some-project-name\\" (production)
Expand Down
18 changes: 7 additions & 11 deletions packages/wrangler/src/secret/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import type {
CommonYargsArgv,
StrictYargsOptionsToInterface,
} from "../yargs-types";
import { strict } from "node:assert";

export const VERSION_NOT_DEPLOYED_ERR_CODE = 10215;

Expand Down Expand Up @@ -429,9 +428,7 @@ export const secretBulkHandler = async (secretBulkArgs: SecretBulkArgs) => {
const content = await parseBulkInputToObject(secretBulkArgs.json);

if (!content) {
return logger.error(
`🚨 No content found in file, or piped input.`
);
return logger.error(`🚨 No content found in file, or piped input.`);
}

function getSettings() {
Expand Down Expand Up @@ -550,14 +547,13 @@ export async function parseBulkInputToObject(input?: string) {
const fileContent = readFileSync(jsonFilePath);
try {
content = parseJSON<Record<string, string>>(fileContent);
} catch(e) {
} catch (e) {
content = dotenvParse(fileContent);
// dotenvParse does not error unless fileContent is undefined, no keys === error
if(Object.keys(content).length === 0) {
throw e
if (Object.keys(content).length === 0) {
throw e;
}
}

} catch (e) {
throw new FatalError(
`The contents of "${input}" is not valid JSON: "${e}"`
Expand All @@ -573,11 +569,11 @@ export async function parseBulkInputToObject(input?: string) {
}
try {
content = parseJSON<Record<string, string>>(pipedInput);
} catch(e) {
} catch (e) {
content = dotenvParse(pipedInput);
// dotenvParse does not error unless fileContent is undefined, no keys === error
if(Object.keys(content).length === 0) {
throw e
if (Object.keys(content).length === 0) {
throw e;
}
}
} catch {
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/versions/secrets/bulk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const versionsSecretBulkCommand = createCommand({
describe: "A tag for this version",
type: "string",
requiresArg: true,
}
},
},
positionalArgs: ["json"],
handler: async function versionsSecretPutBulkHandler(args, { config }) {
Expand Down

0 comments on commit 5de1ee5

Please sign in to comment.