Skip to content

Commit

Permalink
fix: path should be optional for wrangler d1 backup download (#2548)
Browse files Browse the repository at this point in the history
* fix: path should be optional for wrangler d1 backup download

* Create grumpy-pants-relax.md

* Update backups.tsx
  • Loading branch information
rozenmd authored Jan 16, 2023
1 parent b44e1a7 commit 4db768f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .changeset/grumpy-pants-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"wrangler": patch
---

fix: path should be optional for wrangler d1 backup download

This PR fixes a bug that forces folks to provide a `--output` flag to `wrangler d1 backup download`.
6 changes: 1 addition & 5 deletions packages/wrangler/src/d1/backups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,7 @@ export const DownloadHandler = withConfig<BackupDownloadArgs>(
name
);
const filename =
output ||
path.join(
process.env.INIT_CWD as string,
`${name}.${backupId.slice(0, 8)}.sqlite3`
);
output || path.resolve(`${name}.${backupId.slice(0, 8)}.sqlite3`);

logger.log(`🌀 Downloading backup ${backupId} from '${name}'`);
const response = await getBackupResponse(accountId, db.uuid, backupId);
Expand Down

0 comments on commit 4db768f

Please sign in to comment.