Merge pull request #38515 from Calinou/cli-scene-allow-res-tres

Allow `.res` and `.tres` extensions in the scene CLI positional argument
This commit is contained in:
Rémi Verschelde 2020-05-20 11:46:27 +02:00 committed by GitHub
commit c404fe5848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -1532,7 +1532,11 @@ bool Main::start() {
} else if (args[i].length() && args[i][0] != '-' && positional_arg == "") {
positional_arg = args[i];
if (args[i].ends_with(".scn") || args[i].ends_with(".tscn") || args[i].ends_with(".escn")) {
if (args[i].ends_with(".scn") ||
args[i].ends_with(".tscn") ||
args[i].ends_with(".escn") ||
args[i].ends_with(".res") ||
args[i].ends_with(".tres")) {
// Only consider the positional argument to be a scene path if it ends with
// a file extension associated with Godot scenes. This makes it possible
// for projects to parse command-line arguments for custom CLI arguments