Small bug fixes [release]

This commit is contained in:
crschnick
2023-03-28 16:58:23 +00:00
parent 1ff572da03
commit 53068eb943
5 changed files with 22 additions and 23 deletions

View File

@@ -99,7 +99,10 @@ final class FileListModel {
}
if (entry.isDirectory()) {
fileSystemModel.cd(entry.getPath());
var dir = fileSystemModel.cd(entry.getPath());
if (dir.isPresent()) {
fileSystemModel.cd(dir.get());
}
} else {
FileOpener.openInTextEditor(entry);
}

View File

@@ -50,27 +50,21 @@ public class ScriptHelper {
}
public static String constructInitFile(
ShellControl processControl, List<String> init, String toExecuteInShell) {
ShellControl processControl, List<String> init, String toExecuteInShell,boolean login) {
ShellDialect t = processControl.getShellDialect();
// We always want to generate and init file
if (init.size() == 0 && toExecuteInShell == null) {
return createExecScript(processControl, processControl.getShellDialect().getNewLine().getNewLineString());
}
if (init.size() == 0) {
// Check for special case of the command to be executed just being another shell script
if (toExecuteInShell.endsWith(".sh") || toExecuteInShell.endsWith(".bat")) {
return toExecuteInShell;
}
}
String nl = t.getNewLine().getNewLineString();
var content = String.join(nl, init) + nl;
var applyCommand = t.applyRcFileCommand();
if (applyCommand != null) {
content = applyCommand + "\n" + content;
if (login) {
var applyProfilesCommand = t.applyProfileFilesCommand();
if (applyProfilesCommand != null) {
content = applyProfilesCommand + "\n" + content;
}
}
var applyRcCommand = t.applyRcFileCommand();
if (applyRcCommand != null) {
content = applyRcCommand + "\n" + content;
}
if (toExecuteInShell != null) {