Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(cli): Optimize setting up node_modules on macOS #23980

Merged
merged 9 commits into from
May 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
Hardlink npm cache
  • Loading branch information
nathanwhit committed May 25, 2024
commit 52a9f73264b5079fb75bf64b9e7025401cd21d44
4 changes: 2 additions & 2 deletions cli/npm/managed/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::args::CacheSetting;
use crate::http_util::HttpClient;
use crate::npm::common::maybe_auth_header_for_npm_registry;
use crate::npm::NpmCacheDir;
use crate::util::fs::clone_dir_recursive;
use crate::util::fs::hard_link_dir_recursive;
use crate::util::progress_bar::ProgressBar;

use super::tarball::verify_and_extract_tarball;
Expand Down Expand Up @@ -195,7 +195,7 @@ impl NpmCache {
// it seems Windows does an "AccessDenied" error when moving a
// directory with hard links, so that's why this solution is done
with_folder_sync_lock(&folder_id.nv, &package_folder, || {
clone_dir_recursive(&original_package_folder, &package_folder)
hard_link_dir_recursive(&original_package_folder, &package_folder)
})?;
Ok(())
}
Expand Down