mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 00:50:31 +00:00
Various small fixes
This commit is contained in:
parent
b7b3acf168
commit
99d867965b
7 changed files with 12 additions and 16 deletions
|
@ -46,8 +46,7 @@ public interface BrowserAction {
|
|||
default List<BrowserEntry> resolveFilesIfNeeded(List<BrowserEntry> selected) {
|
||||
return automaticallyResolveLinks()
|
||||
? selected.stream()
|
||||
.map(browserEntry ->
|
||||
new BrowserEntry(browserEntry.getRawFileEntry().resolved(), browserEntry.getModel()))
|
||||
.map(browserEntry -> new BrowserEntry(browserEntry.getRawFileEntry().resolved(), browserEntry.getModel()))
|
||||
.toList()
|
||||
: selected;
|
||||
}
|
||||
|
|
|
@ -54,6 +54,10 @@ public class AppLayoutModel {
|
|||
}
|
||||
|
||||
public static void reset() {
|
||||
if (INSTANCE == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
AppCache.update("layoutState", INSTANCE.savedState);
|
||||
INSTANCE = null;
|
||||
}
|
||||
|
|
|
@ -74,7 +74,9 @@ public class LauncherCommand implements Callable<Integer> {
|
|||
cmd.parseArgs(args);
|
||||
cmd.execute(args);
|
||||
} catch (Throwable t) {
|
||||
var e = ErrorEvent.fromThrowable(t).term().build();
|
||||
// Fix serialization issues with exception class
|
||||
var converted = t instanceof CommandLine.UnmatchedArgumentException u ? new IllegalArgumentException(u.getMessage()) : t;
|
||||
var e = ErrorEvent.fromThrowable(converted).term().build();
|
||||
// Print error in case we launched from the command-line
|
||||
new LogErrorHandler().handle(e);
|
||||
e.handle();
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
package io.xpipe.app.storage;
|
||||
|
||||
public class DataNames {
|
||||
|
||||
public static String cleanName(String name) {
|
||||
return name.replaceAll("[\\\\/:*?\"<>|]", "_");
|
||||
}
|
||||
}
|
|
@ -76,9 +76,8 @@ public class TerminalLauncher {
|
|||
type.launch(config);
|
||||
latch.await();
|
||||
} catch (Exception ex) {
|
||||
var modMsg = ex.getMessage() != null && ex.getMessage().contains("Unable to find application named") ? ex.getMessage() + " in installed Applications on this system" : ex;
|
||||
throw ErrorEvent.expected(new IOException(
|
||||
"Unable to launch terminal " + type.toTranslatedString().getValue() + ": " + modMsg, ex));
|
||||
var modMsg = ex.getMessage() != null && ex.getMessage().contains("Unable to find application named") ? ex.getMessage() + " in installed Applications on this system" : ex.getMessage();
|
||||
throw ErrorEvent.expected(new IOException("Unable to launch terminal " + type.toTranslatedString().getValue() + ": " + modMsg, ex));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -268,7 +268,7 @@ public abstract class BaseCompressAction implements BrowserAction, BranchAction
|
|||
|
||||
@Override
|
||||
protected void create(String fileName, OpenFileSystemModel model, List<BrowserEntry> entries) {
|
||||
var tar = CommandBuilder.of().add("tar", "-c", "-v").addIf(gz, "-z").add("-f").addFile(fileName);
|
||||
var tar = CommandBuilder.of().add("tar", "-c").addIf(gz, "-z").add("-f").addFile(fileName);
|
||||
var base = new FilePath(model.getCurrentDirectory().getPath());
|
||||
|
||||
if (directory) {
|
||||
|
|
|
@ -44,7 +44,7 @@ public class BaseUntarAction implements ApplicationPathAction, LeafAction {
|
|||
if (toDirectory) {
|
||||
c.add("-C").addFile(target);
|
||||
}
|
||||
c.add("-xv").addIf(gz, "-z").add("-f");
|
||||
c.add("-x").addIf(gz, "-z").add("-f");
|
||||
c.addFile(entry.getRawFileEntry().getPath());
|
||||
if (toDirectory) {
|
||||
model.getFileSystem().mkdirs(target);
|
||||
|
|
Loading…
Reference in a new issue