diff --git a/tools/utils/PlatformSetup.hx b/tools/utils/PlatformSetup.hx index 32597d25a..ea1eba35a 100644 --- a/tools/utils/PlatformSetup.hx +++ b/tools/utils/PlatformSetup.hx @@ -865,17 +865,35 @@ class PlatformSetup if (answer == YES || answer == ALWAYS) { - try + if (System.hostPlatform == MAC) { - 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); - installedCommand = true; + 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); + 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) @@ -1081,23 +1099,45 @@ class PlatformSetup 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", 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", [ + 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("", "chmod", ["755", "/usr/local/bin/openfl"], false); + System.runCommand("", "sudo", ["chmod", "755", "/usr/local/bin/openfl"], false); installedCommand = true; } - catch (e:Dynamic) {} } if (!installedCommand)