godots icon indicating copy to clipboard operation
godots copied to clipboard

[Idea] Automatic version selection and launch from CLI

Open rdlaitila opened this issue 1 year ago • 1 comments

Note this has some overlap with https://github.com/MakovWait/godots/issues/23.

Just looking to get the idea out in the wild. Obviously the big pain point Godots and other launchers attempt to remedy is the pain of managing so many godot versions and installations. This is being solved quite nicely on the UI side giving the user an easy way to launch projects with the correct version of godot for that project.

However when configuring other tools such as IDE run/debug settings etc those tools expect you to supply paths to the executable to launch (ie: c:\path\to\my\godot.exe myscene.tscn). Its good practice to shove those paths into environment variables so those configurations can be somewhat portable (ie: %GODOT4% myscene.tscn). The trouble comes when moving between projects it becomes messy trying to wrangle the correct path variables for different versions of godot for a project. For instance my %GODOT4% environment variable may be pointing to the correct version of godot for Project A, but not for Project B.

You could generate one global environment variable for each engine version, %GODOT411% %GODOT420% etc. but this tends to get messy.

Would be nice if Godots could be the central launcher/wrapper for invoking the correct engine version for a given project on the CLI:

# Detects required engine version dynamically from project config and launches godot
c:\path\to\godots.exe c:\path\to\project\myscene.tscn 

I could then shove the Godots executable in my env and use it everywhere %GODOTS% -> c:\path\to\godots.exe -> %GODOTS% myscene.tscn

I did a bit of looking in the engine code I don't think godot gives scripts full control or access to program arguments, such a feature may require a separate wrapping script or program to call into godots to do the version selection and then invoke the godot engine and entrypoint scene/script.

Thanks for wonderful tool!

rdlaitila avatar Oct 02 '23 14:10 rdlaitila