Skip to content

Commit

Permalink
Merge pull request #1286 from Barsik-sus/willbe_allow_dirty_during_pl…
Browse files Browse the repository at this point in the history
…anning

READY: (willbe): Update cargo pack options to accommodate dirty crates
  • Loading branch information
Wandalen authored May 1, 2024
2 parents 58ef254 + e270c55 commit de533df
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 4 additions & 3 deletions module/move/willbe/src/action/publish_diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ mod private
let name = &package.name()?;
let version = &package.version()?;

_ = cargo::pack( cargo::PackOptions::former().path( dir.as_ref() ).dry( false ).form() )?;
let l = CrateArchive::read( packed_crate::local_path( name, version, dir.clone() )? )?;
let r = CrateArchive::download_crates_io( name, version ).unwrap();
_ = cargo::pack( cargo::PackOptions::former().path( dir.as_ref() ).allow_dirty( true ).no_verify( true ).dry( false ).form() )?;
let l = CrateArchive::read( packed_crate::local_path( name, version, dir )? )?;
let r = CrateArchive::download_crates_io( name, version ).unwrap();


if let Some( out_path ) = &o.keep_archive
{
Expand Down
2 changes: 2 additions & 0 deletions module/move/willbe/src/entity/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ mod private
let pack = cargo::PackOptions
{
path : crate_dir.as_ref().into(),
allow_dirty : self.dry,
no_verify : self.dry,
temp_path : self.base_temp_dir.clone(),
dry : self.dry,
};
Expand Down
6 changes: 6 additions & 0 deletions module/move/willbe/src/tool/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ mod private
pub struct PackOptions
{
pub( crate ) path : PathBuf,
#[ default( false ) ]
pub( crate ) allow_dirty : bool,
#[ default( false ) ]
pub( crate ) no_verify : bool,
pub( crate ) temp_path : Option< PathBuf >,
pub( crate ) dry : bool,
}
Expand All @@ -33,6 +37,8 @@ mod private
{
[ "package".to_string() ]
.into_iter()
.chain( if self.allow_dirty { Some( "--allow-dirty".to_string() ) } else { None } )
.chain( if self.no_verify { Some( "--no-verify".to_string() ) } else { None } )
.chain( self.temp_path.clone().map( | p | vec![ "--target-dir".to_string(), p.to_string_lossy().into() ] ).into_iter().flatten() )
.collect()
}
Expand Down

0 comments on commit de533df

Please sign in to comment.