mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-03 02:30:02 +00:00
Feature/fix no symlink (#432)
* Refactor `BinFile::from_product`: Simplify logic flow. * Fix `--no-symlink` behavior Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
e3cf3e9e3a
commit
c15903684f
2 changed files with 65 additions and 48 deletions
|
@ -238,6 +238,7 @@ async fn resolve_inner(
|
|||
&package,
|
||||
&install_path,
|
||||
&binaries,
|
||||
opts.no_symlinks,
|
||||
)
|
||||
.await
|
||||
{
|
||||
|
@ -281,6 +282,7 @@ async fn download_extract_and_verify(
|
|||
package: &Package<Meta>,
|
||||
install_path: &Path,
|
||||
binaries: &[Product],
|
||||
no_symlinks: bool,
|
||||
) -> Result<Vec<bins::BinFile>, BinstallError> {
|
||||
// Build final metadata
|
||||
let meta = fetcher.target_meta();
|
||||
|
@ -322,6 +324,7 @@ async fn download_extract_and_verify(
|
|||
binaries,
|
||||
bin_path.to_path_buf(),
|
||||
install_path.to_path_buf(),
|
||||
no_symlinks,
|
||||
)?;
|
||||
|
||||
for bin_file in bin_files.iter() {
|
||||
|
@ -340,6 +343,7 @@ fn collect_bin_files(
|
|||
binaries: &[Product],
|
||||
bin_path: PathBuf,
|
||||
install_path: PathBuf,
|
||||
no_symlinks: bool,
|
||||
) -> Result<Vec<bins::BinFile>, BinstallError> {
|
||||
// List files to be installed
|
||||
// based on those found via Cargo.toml
|
||||
|
@ -363,7 +367,7 @@ fn collect_bin_files(
|
|||
// Create bin_files
|
||||
let bin_files = binaries
|
||||
.iter()
|
||||
.map(|p| bins::BinFile::from_product(&bin_data, p, &bin_dir))
|
||||
.map(|p| bins::BinFile::from_product(&bin_data, p, &bin_dir, no_symlinks))
|
||||
.collect::<Result<Vec<_>, BinstallError>>()?;
|
||||
|
||||
let mut source_set = BTreeSet::new();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue