PlatformSetup: sudo still required on Linux

This commit is contained in:
Josh Tynjala
2020-07-07 12:35:36 -07:00
parent 461a73fed3
commit 164558726a

View File

@@ -865,17 +865,35 @@ class PlatformSetup
if (answer == YES || answer == ALWAYS) if (answer == YES || answer == ALWAYS)
{ {
try if (System.hostPlatform == MAC)
{ {
System.runCommand("", "cp", [ try
"-f", {
Haxelib.getPath(new Haxelib("lime")) + "/templates/bin/lime.sh", System.runCommand("", "cp", [
"/usr/local/bin/lime" "-f",
], false); Haxelib.getPath(new Haxelib("lime")) + "/templates/bin/lime.sh",
System.runCommand("", "chmod", ["755", "/usr/local/bin/lime"], false); "/usr/local/bin/lime"
installedCommand = true; ], false);
System.runCommand("", "chmod", ["755", "/usr/local/bin/lime"], false);
installedCommand = true;
}
catch (e:Dynamic) {}
}
else
{
try
{
System.runCommand("", "sudo", [
"cp",
"-f",
Haxelib.getPath(new Haxelib("lime")) + "/templates/bin/lime.sh",
"/usr/local/bin/lime"
], false);
System.runCommand("", "sudo", ["chmod", "755", "/usr/local/bin/lime"], false);
installedCommand = true;
}
catch (e:Dynamic) {}
} }
catch (e:Dynamic) {}
} }
if (!installedCommand) if (!installedCommand)
@@ -1081,23 +1099,45 @@ class PlatformSetup
if (answer == YES || answer == ALWAYS) if (answer == YES || answer == ALWAYS)
{ {
try
if (System.hostPlatform == MAC)
{ {
System.runCommand("", "cp", [ try
{
System.runCommand("", "cp", [
"-f",
Haxelib.getPath(new Haxelib("lime")) + "/templates/bin/lime.sh",
"/usr/local/bin/lime"
], false);
System.runCommand("", "chmod", ["755", "/usr/local/bin/lime"], false);
System.runCommand("", "cp", [
"-f",
System.findTemplate(project.templatePaths, "bin/openfl.sh"),
"/usr/local/bin/openfl"
], false);
System.runCommand("", "chmod", ["755", "/usr/local/bin/openfl"], false);
installedCommand = true;
}
catch (e:Dynamic) {}
}
else
{
System.runCommand("", "sudo", [
"cp",
"-f", "-f",
Haxelib.getPath(new Haxelib("lime")) + "/templates/bin/lime.sh", Haxelib.getPath(new Haxelib("lime")) + "/templates/bin/lime.sh",
"/usr/local/bin/lime" "/usr/local/bin/lime"
], false); ], false);
System.runCommand("", "chmod", ["755", "/usr/local/bin/lime"], false); System.runCommand("", "sudo", ["chmod", "755", "/usr/local/bin/lime"], false);
System.runCommand("", "cp", [ System.runCommand("", "sudo", [
"cp",
"-f", "-f",
System.findTemplate(project.templatePaths, "bin/openfl.sh"), System.findTemplate(project.templatePaths, "bin/openfl.sh"),
"/usr/local/bin/openfl" "/usr/local/bin/openfl"
], false); ], false);
System.runCommand("", "chmod", ["755", "/usr/local/bin/openfl"], false); System.runCommand("", "sudo", ["chmod", "755", "/usr/local/bin/openfl"], false);
installedCommand = true; installedCommand = true;
} }
catch (e:Dynamic) {}
} }
if (!installedCommand) if (!installedCommand)