Skip to content

Conversation

@artsich
Copy link
Contributor

@artsich artsich commented Oct 10, 2023

Example of usage
Godots.exe --headless -open=4.1.1 -- --path "C:/Users/cli-godot-example" "C:/cli-godot-example/main.tscn" -- -game_arg true

  • Mac OS support

@artsich artsich force-pushed the main branch 2 times, most recently from 64b8243 to 42e8052 Compare October 10, 2023 21:37

if (parsed_args.size() >= 1):
if "open" in parsed_args:
pass
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

src/main/main.gd Outdated
_exit()
else:
print("Run window mode")
add_child.call_deferred(windowMainScene.instantiate())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like we don't need to preload it

add_child.call_deferred(load("res://src/main/window_main.tscn").instantiate())

and remove line::3

const windowMainScene: PackedScene = preload("res://src/main/window_main.tscn")

for e in all():
if (e.name.contains(name)):
return e;
return null;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove ;

func retrieve_by_name_pattern(name: String) -> LocalEditor:
for e in all():
if (e.name.contains(name)):
return e;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;


func retrieve_by_name_pattern(name: String) -> LocalEditor:
for e in all():
if (e.name.contains(name)):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.name.findn(name) > -1

should be better

tags_edited.emit()

func open(args: PackedStringArray):
print("Run editor with arguments: ", args)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use

Output.push("Run editor with arguments: %s" % args)

@artsich artsich marked this pull request as draft October 11, 2023 08:39
@artsich artsich changed the title WIP: Add godots cli open command. Add godots cli open command. Oct 11, 2023
@artsich artsich force-pushed the main branch 2 times, most recently from da0f241 to 3795cab Compare October 11, 2023 11:10
@artsich artsich marked this pull request as ready for review October 11, 2023 11:12

const dir = preload("res://src/extensions/dir.gd")

const mac_os_editor_path_postfix = "/Contents/MacOS/Godot"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

	var mac_os_editor_path_postfix:
		get: return _section.get_value("mac_os_editor_path_postfix", "/Contents/MacOS/Godot")

var pid = OS.create_process(process_args.path, process_args.args)

if (pid == -1):
Output.push('An array occured when create editor process')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'An array...' looks like a typo

@SeremTitus
Copy link
Contributor

@JillyMan, can you consider adding Godots cli argument -recent which is a shorthand for the last path project opened
such that something like Godots.exe -recent will open the last project opened using Godots.

Am not sure this proposal is in the scope of your commit ,however, any response will be appreciated

@artsich
Copy link
Contributor Author

artsich commented Oct 15, 2023

@JillyMan, can you consider adding Godots cli argument -recent which is a shorthand for the last path project opened such that something like Godots.exe -recent will open the last project opened using Godots.

Am not sure this proposal is in the scope of your commit ,however, any response will be appreciated

Hi @SeremTitus I'm fine with this cli argument. Will do it in separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants