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

@@ -864,6 +864,8 @@ class PlatformSetup
}
if (answer == YES || answer == ALWAYS)
{
if (System.hostPlatform == MAC)
{
try
{
@@ -877,6 +879,22 @@ class PlatformSetup
}
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) {}
}
}
if (!installedCommand)
{
@@ -1080,6 +1098,9 @@ class PlatformSetup
}
if (answer == YES || answer == ALWAYS)
{
if (System.hostPlatform == MAC)
{
try
{
@@ -1099,6 +1120,25 @@ class PlatformSetup
}
catch (e:Dynamic) {}
}
else
{
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);
System.runCommand("", "sudo", [
"cp",
"-f",
System.findTemplate(project.templatePaths, "bin/openfl.sh"),
"/usr/local/bin/openfl"
], false);
System.runCommand("", "sudo", ["chmod", "755", "/usr/local/bin/openfl"], false);
installedCommand = true;
}
}
if (!installedCommand)
{