chore(publish): add --dry-run flag (#21895)

This commit is contained in:
Bartek Iwańczuk 2024-01-11 22:17:03 +01:00 committed by GitHub
parent 9268df5f34
commit f45ceb2320
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 0 deletions

View file

@ -328,6 +328,7 @@ pub struct VendorFlags {
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct PublishFlags {
pub token: Option<String>,
pub dry_run: bool,
}
#[derive(Clone, Debug, Eq, PartialEq)]
@ -2379,6 +2380,12 @@ fn publish_subcommand() -> Command {
.long("token")
.help("The API token to use when publishing. If unset, interactive authentication is be used")
)
.arg(
Arg::new("dry-run")
.long("dry-run")
.help("Prepare the package for publishing performing all checks and validations without uploading")
.action(ArgAction::SetTrue),
)
})
}
@ -3812,6 +3819,7 @@ fn vendor_parse(flags: &mut Flags, matches: &mut ArgMatches) {
fn publish_parse(flags: &mut Flags, matches: &mut ArgMatches) {
flags.subcommand = DenoSubcommand::Publish(PublishFlags {
token: matches.remove_one("token"),
dry_run: matches.get_flag("dry-run"),
});
}