2022-10-10 20:59:43 -05:00
|
|
|
extends Node
|
|
|
|
|
2022-10-13 09:51:32 -05:00
|
|
|
var versions_dir_path = OS.get_config_dir()+"/UltraFlare/versions"
|
2022-10-10 20:59:43 -05:00
|
|
|
var versions_dir = Directory.new()
|
2022-10-13 09:51:32 -05:00
|
|
|
var executable = File.new()
|
|
|
|
var os_name = ""
|
|
|
|
var suffix = ""
|
2022-10-10 20:59:43 -05:00
|
|
|
|
|
|
|
func get_versions():
|
|
|
|
var versions = []
|
|
|
|
versions_dir.open(versions_dir_path)
|
|
|
|
versions_dir.list_dir_begin(true)
|
|
|
|
|
|
|
|
var file_name = versions_dir.get_next()
|
|
|
|
while file_name != "":
|
2022-10-13 09:51:32 -05:00
|
|
|
if executable.file_exists(versions_dir_path+"/"+file_name+"/UltraFlare-"+os_name+"-x86_64"+suffix):
|
|
|
|
versions.append(file_name)
|
|
|
|
|
2022-10-10 20:59:43 -05:00
|
|
|
file_name = versions_dir.get_next()
|
|
|
|
|
|
|
|
versions_dir.list_dir_end()
|
2022-10-13 09:51:32 -05:00
|
|
|
#versions.sort()
|
2022-10-10 20:59:43 -05:00
|
|
|
|
|
|
|
return versions
|
|
|
|
|
|
|
|
|
|
|
|
func _ready():
|
2022-10-13 09:51:32 -05:00
|
|
|
if OS.get_name() == "X11":
|
|
|
|
os_name = "linux"
|
|
|
|
elif OS.get_name() == "Windows":
|
|
|
|
os_name = "windows"
|
|
|
|
|
|
|
|
if os_name == "windows":
|
|
|
|
suffix = ".exe"
|
|
|
|
|
2022-10-10 20:59:43 -05:00
|
|
|
if not versions_dir.dir_exists(versions_dir_path):
|
|
|
|
versions_dir.make_dir_recursive(versions_dir_path)
|
|
|
|
|