exp: cross #6
This commit is contained in:
@@ -8,8 +8,15 @@ use std::process::Command;
|
||||
pub struct LocalDriver;
|
||||
|
||||
impl ContextDriver for LocalDriver {
|
||||
fn ensure_available(&self, src: &Path, _dest_root: &str) -> io::Result<PathBuf> {
|
||||
src.canonicalize()
|
||||
fn ensure_available(&self, src: &Path, dest_root: &str) -> io::Result<PathBuf> {
|
||||
let dest_root_path = Path::new(dest_root);
|
||||
let dest = dest_root_path.join(src.file_name().unwrap_or(src.as_os_str()));
|
||||
|
||||
if src != dest {
|
||||
// Copy src inside dest_root
|
||||
self.copy_path(src, &dest)?;
|
||||
}
|
||||
dest.canonicalize()
|
||||
}
|
||||
|
||||
fn create_temp_dir(&self) -> io::Result<String> {
|
||||
@@ -17,8 +24,8 @@ impl ContextDriver for LocalDriver {
|
||||
Ok(temp_dir.keep().to_string_lossy().to_string())
|
||||
}
|
||||
|
||||
fn retrieve_path(&self, _src: &Path, _dest: &Path) -> io::Result<()> {
|
||||
Ok(())
|
||||
fn retrieve_path(&self, src: &Path, dest: &Path) -> io::Result<()> {
|
||||
self.copy_path(src, dest)
|
||||
}
|
||||
|
||||
fn list_files(&self, path: &Path) -> io::Result<Vec<PathBuf>> {
|
||||
|
||||
Reference in New Issue
Block a user