fix: use deploy project cwd

This commit is contained in:
2026-08-23 06:40:16 +05:00
parent a897552e12
commit 92c654d85b
2 changed files with 10 additions and 2 deletions
+6 -1
View File
@@ -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
View File
@@ -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()
);
} }
}) })
} }