mirror of
https://github.com/pesde-pkg/pesde.git
synced 2024-12-12 11:00:36 +00:00
fix: correctly copy workspace packages
This commit is contained in:
parent
745828f926
commit
ac73a15c9d
2 changed files with 12 additions and 3 deletions
|
@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
### Fixed
|
||||
- Add back mistakenly removed updates check caching by @daimond113
|
||||
- Set download error source to inner error to propagate the error by @daimond113
|
||||
- Correctly copy workspace packages by @daimond113
|
||||
|
||||
## [0.5.0-rc.10] - 2024-11-16
|
||||
### Fixed
|
||||
|
|
|
@ -172,7 +172,7 @@ impl PackageFS {
|
|||
let mut read_dirs = VecDeque::from([fs::read_dir(src.to_path_buf())]);
|
||||
while let Some(read_dir) = read_dirs.pop_front() {
|
||||
let mut read_dir = read_dir.await?;
|
||||
while let Some(entry) = read_dir.next_entry().await? {
|
||||
'entry: while let Some(entry) = read_dir.next_entry().await? {
|
||||
let relative_path =
|
||||
RelativePathBuf::from_path(entry.path().strip_prefix(src).unwrap())
|
||||
.unwrap();
|
||||
|
@ -185,10 +185,12 @@ impl PackageFS {
|
|||
|
||||
for other_target in TargetKind::VARIANTS {
|
||||
if target.packages_folder(other_target) == file_name {
|
||||
continue;
|
||||
continue 'entry;
|
||||
}
|
||||
}
|
||||
|
||||
fs::create_dir_all(relative_path.to_path(destination.as_ref())).await?;
|
||||
|
||||
read_dirs.push_back(fs::read_dir(entry.path()));
|
||||
continue;
|
||||
}
|
||||
|
@ -197,7 +199,13 @@ impl PackageFS {
|
|||
continue;
|
||||
}
|
||||
|
||||
fs::copy(entry.path(), relative_path.to_path(destination.as_ref())).await?;
|
||||
let path = relative_path.to_path(destination.as_ref());
|
||||
|
||||
if let Some(parent) = path.parent() {
|
||||
fs::create_dir_all(parent).await?;
|
||||
}
|
||||
|
||||
fs::copy(entry.path(), path).await?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue