Improve macos shortcuts

This commit is contained in:
crschnick 2023-02-05 19:40:47 +00:00
parent eb1dd3fef7
commit e016e9dfc2
2 changed files with 14 additions and 2 deletions

View file

@ -37,7 +37,8 @@ public class AppPrefs {
private static final boolean STORAGE_DIR_FIXED =
!AppProperties.get().getDataDir().equals(AppProperties.DEFAULT_DATA_DIR);
private static final String LOG_LEVEL_PROP = "io.xpipe.app.logLevel";
private static final String DEFAULT_LOG_LEVEL = "info";
// Lets keep this at trace for now, at least for the alpha
private static final String DEFAULT_LOG_LEVEL = "trace";
private static final boolean LOG_LEVEL_FIXED = System.getProperty(LOG_LEVEL_PROP) != null;
private static final String DEVELOPER_MODE_PROP = "io.xpipe.app.developerMode";
private static AppPrefs INSTANCE;

View file

@ -68,7 +68,18 @@ public class DesktopShortcuts {
Rez -append $rsrc -o $iconDestination
""",
icon, target);
ShellStore.local().create().executeSimpleCommand(iconScriptContent);
try (var pc = ShellStore.local().create().start()) {
var base = System.getProperty("user.home") + "/Desktop/" + name;
pc.executeSimpleCommand(pc.getShellType().flatten(pc.getShellType().getMkdirsCommand(base + "/Contents/MacOS")));
var executable = base + "/Contents/MacOS/" + name + ".sh";
pc.executeSimpleCommand(pc.getShellType().getTextFileWriteCommand(content, executable));
pc.executeSimpleCommand(pc.getShellType().getMakeExecutableCommand(executable));
pc.executeSimpleCommand(pc.getShellType().getTextFileWriteCommand("APPL??", base + "/PkgInfo"));
pc.executeSimpleCommand(iconScriptContent);
}
}
public static void create(String target, String name) throws Exception {