Skip to content

Added some confirmation steps. DB pulling which is destructive and me…#530

Open
daviddarke wants to merge 1 commit intopre-releasefrom
feature/added-confirmation-steps
Open

Added some confirmation steps. DB pulling which is destructive and me…#530
daviddarke wants to merge 1 commit intopre-releasefrom
feature/added-confirmation-steps

Conversation

@daviddarke
Copy link
Copy Markdown
Member

…dia pulling which is time consuming

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 18, 2026

🦋 Changeset detected

Latest commit: c5db822

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@atomicsmash/cli Minor

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

@daviddarke daviddarke requested a review from mikeybinns March 18, 2026 15:50
export const command = "pull-database";
export const describe =
"Pull the database down from staging and replace local database.";
export async function handler() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SVG command, although deprecated, has an example of how to add options with Yargs:

export const builder = function (yargs: YargsInstance) {
return yargs
.options({
in: {
demandOption: true,
string: true,
normalize: true,
description: "The directory where the SVGs can be found.",
},
out: {
demandOption: true,
string: true,
normalize: true,
description: "The directory where the SVG sprite will be output.",
},
})
.example("$0 svg --in icons --out public/assets", "");
};

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah like

}

export const command = "pull-media";
export const describe = "Pull the media items from the staging site.";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comment on pull database about no-interaction mode.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +64 to +70
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;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the Proxy ready for use? We may not want to add this until it's ready.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah fair, PR for that soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants