Skip to content

Commit

Permalink
fixup! feat: support outputting ND-JSON files via an environment vari…
Browse files Browse the repository at this point in the history
…able
  • Loading branch information
petebacondarwin committed Aug 6, 2024
1 parent 34ac024 commit 8483a68
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/wrangler/src/versions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from "../index";
import { logger } from "../logger";
import * as metrics from "../metrics";
import { writeOutput } from "../output";
import { requireAuth } from "../user";
import { collectKeyValues } from "../utils/collectKeyValues";
import { versionsDeployHandler, versionsDeployOptions } from "./deploy";
Expand Down Expand Up @@ -241,12 +242,13 @@ export async function versionsUploadHandler(
const cliAlias = collectKeyValues(args.alias);

const accountId = args.dryRun ? undefined : await requireAuth(config);
const name = getScriptName(args, config);

await standardPricingWarning(config);
await versionsUpload({
const { versionId } = await versionsUpload({
config,
accountId,
name: getScriptName(args, config),
name,
rules: getRules(config),
entry,
legacyEnv: isLegacyEnv(config),
Expand Down Expand Up @@ -275,6 +277,15 @@ export async function versionsUploadHandler(
tag: args.tag,
message: args.message,
});

if (versionId && name) {
writeOutput({
type: "version-upload",
version: 1,
worker_id: name,
version_id: versionId,
});
}
}

export default function registerVersionsSubcommands(
Expand Down

0 comments on commit 8483a68

Please sign in to comment.