Added some confirmation steps. DB pulling which is destructive and me…#530
Added some confirmation steps. DB pulling which is destructive and me…#530daviddarke wants to merge 1 commit intopre-releasefrom
Conversation
…dia pulling which is time consuming
🦋 Changeset detectedLatest commit: c5db822 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| export const command = "pull-database"; | ||
| export const describe = | ||
| "Pull the database down from staging and replace local database."; | ||
| export async function handler() { |
There was a problem hiding this comment.
We should add a command option/flag so this can be run non-interactively e.g. in CI.
I'd suggest something like pull-database --confirm=destructive if you want to be explicit for multiple options or pull-database --no-interaction if you want to skip all questions at once.
There was a problem hiding this comment.
The SVG command, although deprecated, has an example of how to add options with Yargs:
packages/packages/cli/src/commands/svg.ts
Lines 11 to 28 in 1c767f8
| } | ||
|
|
||
| export const command = "pull-media"; | ||
| export const describe = "Pull the media items from the staging site."; |
There was a problem hiding this comment.
See other comment on pull database about no-interaction mode.
| const isConfirmed = await confirmAction( | ||
| "You are about to download gigabytes of media when there is a 'proxy media' option available. Would you like to proceed? (y/n) ", | ||
| ); | ||
| if (!isConfirmed) { | ||
| console.log("Aborted. No media downloaded"); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Is the Proxy ready for use? We may not want to add this until it's ready.
There was a problem hiding this comment.
Yeah fair, PR for that soon
…dia pulling which is time consuming