fix: use deploy project cwd
This commit is contained in:
+6
-1
@@ -50,7 +50,12 @@ pub fn deploy(name: &str, project: &Project, dry_run: bool) -> Result<()> {
|
|||||||
for rule in &project.sync {
|
for rule in &project.sync {
|
||||||
let step = Instant::now();
|
let step = Instant::now();
|
||||||
let target = rule.target.to_string_lossy().to_string();
|
let target = rule.target.to_string_lossy().to_string();
|
||||||
let result = sync::upload(&mut session, &rule.source, &target);
|
let source = if rule.source.is_absolute() {
|
||||||
|
rule.source.clone()
|
||||||
|
} else {
|
||||||
|
project.workdir.join(&rule.source)
|
||||||
|
};
|
||||||
|
let result = sync::upload(&mut session, &source, &target);
|
||||||
let label = format!("transferring {} to {}...", rule.source.display(), target);
|
let label = format!("transferring {} to {}...", rule.source.display(), target);
|
||||||
match result {
|
match result {
|
||||||
Ok(stats) => success_line(
|
Ok(stats) => success_line(
|
||||||
|
|||||||
+4
-1
@@ -38,7 +38,10 @@ pub fn upload(session: &mut Session, source: &Path, target: &str) -> Result<Stat
|
|||||||
} else if source.is_file() {
|
} else if source.is_file() {
|
||||||
upload_file(session, source, target).await
|
upload_file(session, source, target).await
|
||||||
} else {
|
} else {
|
||||||
bail!("sync source '{}' does not exist", source.display());
|
bail!(
|
||||||
|
"sync source '{}' does not exist (relative paths are resolved against project workdir)",
|
||||||
|
source.display()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user