From 6d0bb397860ba831d8d36408dee1585246685e77 Mon Sep 17 00:00:00 2001 From: crschnick Date: Sun, 6 Oct 2024 03:06:53 +0000 Subject: [PATCH] bsd tar fixes --- .../ext/base/browser/compress/BaseCompressAction.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ext/base/src/main/java/io/xpipe/ext/base/browser/compress/BaseCompressAction.java b/ext/base/src/main/java/io/xpipe/ext/base/browser/compress/BaseCompressAction.java index 5b0964d83..fb35c519f 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/browser/compress/BaseCompressAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/browser/compress/BaseCompressAction.java @@ -272,9 +272,11 @@ public abstract class BaseCompressAction implements BrowserAction, BranchAction var base = new FilePath(model.getCurrentDirectory().getPath()); if (directory) { - var dir = new FilePath(entries.getFirst().getRawFileEntry().getPath()).toDirectory().toUnix(); - var command = CommandBuilder.of().add("find").addFile(dir).add("|", "sed", "s,^" + dir + ",,", "|"); - command.add(tar).add("-C").addFile(dir).add("-T", "-"); + var dir = new FilePath(entries.getFirst().getRawFileEntry().getPath()); + // Fix for bsd find, remove / + var command = CommandBuilder.of().add("find").addFile(dir.removeTrailingSlash().toUnix()) + .add("|", "sed").addLiteral("s,^" + dir.toDirectory().toUnix() + "*,,").add("|"); + command.add(tar).add("-C").addFile(dir.toDirectory().toUnix()).add("-T", "-"); model.runCommandAsync(command, true); } else { var command = CommandBuilder.of().add(tar);