-
Notifications
You must be signed in to change notification settings - Fork 44
Open Recent project command #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7173448 to
381c383
Compare
381c383 to
e626d27
Compare
| patched_args.push_back("-e") | ||
| as_process(patched_args).create_process() | ||
| _ProjectsCache.set_last_opened_project(path) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func edit():
as_process(["-e"]).create_process()
_ProjectsCache.set_last_opened_project(path)
func run():
as_process(["-r"]).create_process()There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| func _run_with_editor(item, editor_flag, auto_close): | ||
| item.as_process([editor_flag]).create_process() | ||
| func _run_with_editor(item: Projects.Item, editor_flag, auto_close): | ||
| item.edit([editor_flag]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given: take into account the proposed methods project.edit and project.run
so here we need to call appropriate method based on editor_flag. since editor_flag is a string, we can handle it with if-else
if editor_flag == '-e':
item.edit()
if editor_flag == '-r':
item.run()or use some cool polymorphic stuff
editor_flag.call(item)where editor flag is Callable with example definition:
func (item): item.edit()
func (item): item.run()There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| func _init(user_args: PackedStringArray): | ||
| self.user_args = user_args | ||
|
|
||
| var _editors: LocalEditors.List |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like _editors is unused here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used in execute method to load editors
60a17bb to
a206100
Compare
New Argument for
godotsThe new argument serves to open the last Godot project.
Usage
godots.exe [--recent or -r]