Skip to content

Commit 4a51d64

Browse files
authored
cli: Default to unstripped dst if target dir is outside of current dir (#9)
One could configure shared target-dir for cargo, for example: ```bash ❯ cat ~/.cargo/config.toml [build] target-dir = "/tmp/rustc-target-dir" ``` Which means that the packaged workflow is not in a subfolder of the current folder and stripping the current folder as prefix results in an error. This PR falls back to printing the full path in that case, for example: ``` ❯ powerpack package Finished release [optimized] target(s) in 0.13s Replaced binary at `workflow/alfred-test` Packaged workflow at `/tmp/rustc-target-dir/workflow/alfred-test.alfredworkflow` ```
1 parent 2b912ca commit 4a51d64

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/cli/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ fn package() -> Result<()> {
187187
"Packaged",
188188
format!(
189189
"workflow at `{}`",
190-
dst.strip_prefix(env::current_dir()?)?.display()
190+
dst.strip_prefix(env::current_dir()?)
191+
.unwrap_or(dst)
192+
.display()
191193
),
192194
);
193195

0 commit comments

Comments
 (0)