mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 14:28:42 +00:00
Add new option --locked
that is passed through to cargo-install
(#830)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
0e055dbb7c
commit
96ebcfd08f
4 changed files with 12 additions and 0 deletions
|
@ -188,6 +188,12 @@ pub struct Args {
|
|||
#[clap(help_heading = "Options", long)]
|
||||
pub roots: Option<PathBuf>,
|
||||
|
||||
/// This option will be passed through to all `cargo-install` invocations.
|
||||
///
|
||||
/// It will require `Cargo.lock` to be up to date.
|
||||
#[clap(help_heading = "Options", long)]
|
||||
pub locked: bool,
|
||||
|
||||
/// Deprecated, here for back-compat only. Secure is now on by default.
|
||||
#[clap(hide(true), long)]
|
||||
pub secure: bool,
|
||||
|
|
|
@ -97,6 +97,7 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) -
|
|||
dry_run: args.dry_run,
|
||||
force: args.force,
|
||||
quiet: args.log_level == Some(LevelFilter::Off),
|
||||
locked: args.locked,
|
||||
|
||||
version_req: args.version_req,
|
||||
manifest_path: args.manifest_path,
|
||||
|
|
|
@ -21,6 +21,7 @@ pub struct Options {
|
|||
pub dry_run: bool,
|
||||
pub force: bool,
|
||||
pub quiet: bool,
|
||||
pub locked: bool,
|
||||
|
||||
pub version_req: Option<VersionReq>,
|
||||
pub manifest_path: Option<PathBuf>,
|
||||
|
|
|
@ -150,6 +150,10 @@ impl ResolutionSource {
|
|||
cmd.arg("--force");
|
||||
}
|
||||
|
||||
if opts.locked {
|
||||
cmd.arg("--locked");
|
||||
}
|
||||
|
||||
if !opts.dry_run {
|
||||
let mut child = opts
|
||||
.jobserver_client
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue