Skip to content

Commit

Permalink
Add --force/-f to publish command
Browse files Browse the repository at this point in the history
  • Loading branch information
cnpryer committed Mar 3, 2024
1 parent 37f5ba9 commit 5090537
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ that were not yet released.

_Unreleased_

- Rye's `publish` command not offers `--force` (`-f`) to publish distribution files even if they are already found in the target repository.

- Bumped `uv` to 0.1.13. #760, #820

- Bumped `ruff` to 0.3.0. #821
Expand Down
7 changes: 7 additions & 0 deletions rye/src/cli/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ pub struct Args {
/// Path to alternate CA bundle.
#[arg(long)]
cert: Option<PathBuf>,
/// Force the upload of distribution files if we can. This includes publishing the files if they
/// already exist in the target repository.
#[arg(short, long)]
force: bool,
/// Skip prompts.
#[arg(short, long)]
yes: bool,
Expand Down Expand Up @@ -167,6 +171,9 @@ pub fn execute(cmd: Args) -> Result<(), Error> {
if let Some(cert) = cmd.cert {
publish_cmd.arg("--cert").arg(cert);
}
if cmd.force {
publish_cmd.arg("--skip-existing");
}

if output == CommandOutput::Quiet {
publish_cmd.stdout(Stdio::null());
Expand Down

0 comments on commit 5090537

Please sign in to comment.