From 627a8141cd5eed0b2d26b606129b76daeeaf82a5 Mon Sep 17 00:00:00 2001 From: crschnick Date: Tue, 23 Apr 2024 16:57:11 +0000 Subject: [PATCH] Init file sourcing changes --- app/src/main/java/io/xpipe/app/util/ScriptHelper.java | 11 +++-------- .../main/java/io/xpipe/core/process/ShellDialect.java | 6 +----- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/util/ScriptHelper.java b/app/src/main/java/io/xpipe/app/util/ScriptHelper.java index d02d0fde..16917dc3 100644 --- a/app/src/main/java/io/xpipe/app/util/ScriptHelper.java +++ b/app/src/main/java/io/xpipe/app/util/ScriptHelper.java @@ -48,16 +48,11 @@ public class ScriptHelper { // Normalize line endings content += nl + preInit.stream().flatMap(s -> s.lines()).collect(Collectors.joining(nl)) + nl; - var applyRcCommand = t.applyRcFileCommand(); - if (applyRcCommand != null) { - content += nl + applyRcCommand + nl; - } - // We just apply the profile files always, as we can't be sure that they definitely have been applied. // Especially if we launch something that is not the system default shell - var applyProfilesCommand = t.applyProfileFilesCommand(); - if (applyProfilesCommand != null) { - content += nl + applyProfilesCommand + nl; + var applyCommand = t.applyInitFileCommand(); + if (applyCommand != null) { + content += nl + applyCommand + nl; } if (config.getDisplayName() != null) { diff --git a/core/src/main/java/io/xpipe/core/process/ShellDialect.java b/core/src/main/java/io/xpipe/core/process/ShellDialect.java index baef703a..231a7b30 100644 --- a/core/src/main/java/io/xpipe/core/process/ShellDialect.java +++ b/core/src/main/java/io/xpipe/core/process/ShellDialect.java @@ -62,16 +62,12 @@ public interface ShellDialect { String addToPathVariableCommand(List entries, boolean append); - default String applyRcFileCommand() { + default String applyInitFileCommand() { return null; } String changeTitleCommand(String newTitle); - default String applyProfileFilesCommand() { - return null; - } - CommandControl createStreamFileWriteCommand(ShellControl shellControl, String file, long totalBytes); default String getCdCommand(String directory) {