diff --git a/Stardrop/Assets/Stardrop.sh b/Stardrop/Assets/Stardrop.sh index 46548866..57e7a54f 100644 --- a/Stardrop/Assets/Stardrop.sh +++ b/Stardrop/Assets/Stardrop.sh @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash chmod u+x ./Internal ./Internal diff --git a/Stardrop/Utilities/External/SMAPI.cs b/Stardrop/Utilities/External/SMAPI.cs index 37d49ef6..1ccde2f5 100644 --- a/Stardrop/Utilities/External/SMAPI.cs +++ b/Stardrop/Utilities/External/SMAPI.cs @@ -27,17 +27,17 @@ public static ProcessStartInfo GetPrepareProcess(bool hideConsole) var smapiInfo = new FileInfo(Pathing.GetSmapiPath()); if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) is true) { - arguments = $"-c \"SMAPI_MODS_PATH='{Pathing.GetSelectedModsFolderPath()}' '{Pathing.GetSmapiPath().Replace("StardewModdingAPI.dll", "StardewValley")}'\""; + arguments = $"bash -c \"SMAPI_MODS_PATH='{Pathing.GetSelectedModsFolderPath()}' '{Pathing.GetSmapiPath().Replace("StardewModdingAPI.dll", "StardewValley")}'\""; } else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) is true) { - arguments = $"-c \"'{Pathing.GetSmapiPath().Replace("StardewModdingAPI.dll", "StardewModdingAPI")}' --mods-path '{Pathing.GetSelectedModsFolderPath()}'\""; + arguments = $"bash -c \"'{Pathing.GetSmapiPath().Replace("StardewModdingAPI.dll", "StardewModdingAPI")}' --mods-path '{Pathing.GetSelectedModsFolderPath()}'\""; } Program.helper.Log($"Starting SMAPI with the following arguments: {arguments}"); var processInfo = new ProcessStartInfo { - FileName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? smapiInfo.FullName : "/bin/bash", + FileName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? smapiInfo.FullName : "/usr/bin/env", Arguments = arguments, WorkingDirectory = smapiInfo.DirectoryName, RedirectStandardOutput = false, diff --git a/Stardrop/Views/MainWindow.axaml.cs b/Stardrop/Views/MainWindow.axaml.cs index 5faebc03..d8b31bc7 100644 --- a/Stardrop/Views/MainWindow.axaml.cs +++ b/Stardrop/Views/MainWindow.axaml.cs @@ -1328,8 +1328,8 @@ private async Task HandleStardropUpdateCheck(bool manualCheck = false) string[] arguments = new string[] { $"chmod +x {scriptPath}", $"{scriptPath}" }; var processInfo = new ProcessStartInfo { - FileName = "/bin/bash", - Arguments = $"-c \"{string.Join(" ; ", arguments)}\"", + FileName = "/usr/bin/env", + Arguments = $"bash -c \"{string.Join(" ; ", arguments)}\"", CreateNoWindow = true, UseShellExecute = false }; @@ -2442,7 +2442,7 @@ private void CreateDirectoryJunctions(List arguments) // Prepare the process var processInfo = new ProcessStartInfo { - FileName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "cmd" : "/bin/bash", + FileName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "cmd" : "/usr/bin/env bash", Arguments = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? $"/C {string.Join(" & ", arguments)}" : $"-c \"{string.Join(" ; ", arguments)}\"", RedirectStandardOutput = true, RedirectStandardError = true,