summaryrefslogtreecommitdiff
path: root/cli/args
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-03-07 21:13:36 +0000
committerGitHub <noreply@github.com>2024-03-07 22:13:36 +0100
commit914b7495a854981a3671e24f527d792f2ad1b324 (patch)
treeffe7eac41c1fe904f57973a8afaeb02d7df3a6f6 /cli/args
parente0c9102b49ab333e0229247c446d12e27750785c (diff)
fix(publish): reland error if there are uncommitted changes (#22613) (#22632)
Reverted in https://github.com/denoland/deno/pull/22625
Diffstat (limited to 'cli/args')
-rw-r--r--cli/args/flags.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs
index 05d9a3973..26e0b089a 100644
--- a/cli/args/flags.rs
+++ b/cli/args/flags.rs
@@ -307,6 +307,7 @@ pub struct PublishFlags {
pub token: Option<String>,
pub dry_run: bool,
pub allow_slow_types: bool,
+ pub allow_dirty: bool,
pub no_provenance: bool,
}
@@ -2436,6 +2437,11 @@ fn publish_subcommand() -> Command {
.action(ArgAction::SetTrue),
)
.arg(
+ Arg::new("allow-dirty")
+ .long("allow-dirty")
+ .help("Allow publishing if the repository has uncommited changed")
+ .action(ArgAction::SetTrue),
+ ).arg(
Arg::new("no-provenance")
.long("no-provenance")
.help("Disable provenance attestation. Enabled by default on Github actions, publicly links the package to where it was built and published from.")
@@ -3897,6 +3903,7 @@ fn publish_parse(flags: &mut Flags, matches: &mut ArgMatches) {
token: matches.remove_one("token"),
dry_run: matches.get_flag("dry-run"),
allow_slow_types: matches.get_flag("allow-slow-types"),
+ allow_dirty: matches.get_flag("allow-dirty"),
no_provenance: matches.get_flag("no-provenance"),
});
}
@@ -8620,6 +8627,7 @@ mod tests {
"--no-provenance",
"--dry-run",
"--allow-slow-types",
+ "--allow-dirty",
"--token=asdf",
]);
assert_eq!(
@@ -8629,6 +8637,7 @@ mod tests {
token: Some("asdf".to_string()),
dry_run: true,
allow_slow_types: true,
+ allow_dirty: true,
no_provenance: true,
}),
type_check_mode: TypeCheckMode::Local,