Skip to content

Commit

Permalink
Allow .res and .tres extensions in the scene CLI positional argument
Browse files Browse the repository at this point in the history
This closes godotengine#35709.

(cherry picked from commit 653334c)
  • Loading branch information
Calinou authored and h committed Nov 10, 2020
1 parent 461a52e commit e6af73f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,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
Expand Down

0 comments on commit e6af73f

Please sign in to comment.