Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: always store project-id in deno.json #203

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/subcommands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ async function deploy(opts: DeployOpts): Promise<void> {
} catch (e) {
error(e.message);
}
// opts.project is persisted in deno.json. We want to store the project id even if user provided
// project name to facilitate project renaming.
opts.project = project.id;
projectCreationSpinner.succeed(`Created new project '${opts.project}'.`);
wait({ text: "", indent: 3 }).start().info(
`You can configure the name, env vars, custom domains and more in https://dash.deno.com/projects/${project.name}/settings`,
Expand Down Expand Up @@ -298,6 +295,10 @@ async function deploy(opts: DeployOpts): Promise<void> {
case "success": {
const deploymentKind = opts.prod ? "Production" : "Preview";
deploySpinner!.succeed(`${deploymentKind} deployment complete.`);

// We want to store the project id even if user provided project name
// to facilitate project renaming.
opts.project = project.id;
await configFile.maybeWrite(opts.config, opts, opts.saveConfig);
console.log("\nView at:");
for (const { domain } of event.domainMappings) {
Expand Down