Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Stardrop/Assets/Stardrop.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/usr/bin/env bash
chmod u+x ./Internal
./Internal
6 changes: 3 additions & 3 deletions Stardrop/Utilities/External/SMAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions Stardrop/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down Expand Up @@ -2442,7 +2442,7 @@ private void CreateDirectoryJunctions(List<string> 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,
Expand Down