Skip to content

Commit

Permalink
Fix Open Download Folder not working on OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
noidexe committed Feb 3, 2023
1 parent 165518e commit 77b517c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scenes/OpenFolder.gd
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
extends Button

func _on_OpenFolder_pressed():
# warning-ignore:return_value_discarded
OS.shell_open(ProjectSettings.globalize_path("user://versions/"))
var dir = Directory.new()
if not dir.dir_exists("user://versions/"):
var err = dir.make_dir("user://versions/")
print_debug(err)
var path = ProjectSettings.globalize_path("user://versions/")
if OS.has_feature("OSX"):
path = "file://" + path
var err = OS.shell_open(path)
if err != OK:
print_debug(err)

0 comments on commit 77b517c

Please sign in to comment.