Zip browser menu fixes

This commit is contained in:
crschnick committed 2026-06-09 12:39:24 +00:00
1 parent 36505cb502
commit 9c459e2d76
2 files changed
+11

No files matched your search

@@ -199,6 +199,11 @@ public class CompressMenuProvider implements BrowserMenuBranchProvider {
builder.build().executeAsync();
}
@Override
public boolean isApplicable(BrowserFileSystemTabModel model, List<BrowserEntry> entries) {
return entries.stream().allMatch(browserEntry -> browserEntry.getRawFileEntry().getKind() == FileKind.FILE);
}
@Override
protected String getExtension() {
return "gz";
@@ -5,6 +5,7 @@ import io.xpipe.app.browser.action.BrowserActionProvider;
import io.xpipe.app.browser.file.BrowserEntry;
import io.xpipe.app.ext.FileKind;
import io.xpipe.app.process.CommandBuilder;
import io.xpipe.app.process.ProcessOutputException;
import io.xpipe.app.process.ShellDialects;
import io.xpipe.core.FilePath;
import io.xpipe.core.OsType;
@@ -84,6 +85,11 @@ public class ZipActionProvider implements BrowserActionProvider {
sc.command(command).execute();
}
}
} catch (ProcessOutputException pex) {
// Unix zip does not like empty dirs
if (!pex.getOutput().contains("Nothing to do")) {
throw pex;
}
} finally {
model.refreshSync();
}