Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into cne-pr
Browse files Browse the repository at this point in the history
  • Loading branch information
mcagabe19 committed Nov 3, 2024
2 parents 456c415 + 796d585 commit bd1ee27
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion source/funkin/backend/utils/CoolUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,10 @@ class CoolUtil
*/
@:noUsing public static inline function openURL(url:String) {
#if linux
Sys.command('/usr/bin/xdg-open', [url]);
// generally `xdg-open` should work in every distro
var cmd = Sys.command("xdg-open", [url]);
// run old command JUST IN CASE it fails, which it shouldn't
if (cmd != 0) cmd = Sys.command("/usr/bin/xdg-open", [url]);
#else
FlxG.openURL(url);
#end
Expand Down
5 changes: 4 additions & 1 deletion source/lime/system/System.hx
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,10 @@ class System
#elseif mac
Sys.command("/usr/bin/open", [path]);
#elseif linux
Sys.command("/usr/bin/xdg-open", [path, "&"]);
// generally `xdg-open` should work in every distro
var cmd = Sys.command("xdg-open", [path, "&"]);
// run old command JUST IN CASE it fails, which it shouldn't
if (cmd != 0) cmd = Sys.command("/usr/bin/xdg-open", [path, "&"]);
#elseif (js && html5)
Browser.window.open(path, "_blank");
#elseif flash
Expand Down

0 comments on commit bd1ee27

Please sign in to comment.