Skip to content

Commit

Permalink
fix: right extension on linux and macos platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludea committed Oct 22, 2024
1 parent a7c9b9e commit 8de0cb5
Showing 1 changed file with 14 additions and 25 deletions.
39 changes: 14 additions & 25 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,31 +118,20 @@ function Footer() {
}, [gameName, store, setGlobalError]);

const spawn = () => {
let extension;
let shell: string;
let arg: string[];

switch (platform()) {
case "windows":
extension = ".exe";
shell = "cmd";
arg = ["/C"];
break;
case "macos":
extension = ".app";
shell = "sh";
arg = ["-c"];
break;
case "linux":
extension = ".sh";
shell = "sh";
arg = ["-c"];
break;
default:
extension = "";
shell = "";
arg = [""];
break;
let extension = "";
let shell: string = "";
let arg: string[] = [""];

const host = platform();

if (host === "windows") {
extension = ".exe";
shell = "cmd";
arg = ["/C"];
} else if (host === "linux" || host === "macos") {
extension = "";
shell = "sh";
arg = ["-c"];
}

const command = Command.create(shell, [
Expand Down

0 comments on commit 8de0cb5

Please sign in to comment.