Skip to content

Commit

Permalink
Fix Windows not copying globs or directories
Browse files Browse the repository at this point in the history
Signed-off-by: itowlson <[email protected]>
  • Loading branch information
itowlson committed Dec 12, 2023
1 parent de7d847 commit 62e8454
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions crates/loader/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ impl LocalLoader {
files_mount_strategy: FilesMountStrategy,
cache_root: Option<PathBuf>,
) -> Result<Self> {
let app_root = app_root
.canonicalize()
let app_root = safe_canonicalize(app_root)
.with_context(|| format!("Invalid manifest dir `{}`", app_root.display()))?;
Ok(Self {
app_root,
Expand Down Expand Up @@ -390,6 +389,17 @@ impl LocalLoader {
}
}

#[cfg(not(windows))]
fn safe_canonicalize(path: &Path) -> std::io::Result<PathBuf> {
path.canonicalize()
}

#[cfg(windows)]
fn safe_canonicalize(path: &Path) -> std::io::Result<PathBuf> {
use path_absolutize::Absolutize;
Ok(path.absolutize()?.into_owned())
}

fn locked_metadata(
details: v2::AppDetails,
trigger_types: impl Iterator<Item = String>,
Expand Down

0 comments on commit 62e8454

Please sign in to comment.