Merged
Conversation
7173448 to
381c383
Compare
381c383 to
e626d27
Compare
MakovWait
reviewed
Oct 22, 2023
| patched_args.push_back("-e") | ||
| as_process(patched_args).create_process() | ||
| _ProjectsCache.set_last_opened_project(path) | ||
|
|
Owner
There was a problem hiding this comment.
func edit():
as_process(["-e"]).create_process()
_ProjectsCache.set_last_opened_project(path)
func run():
as_process(["-r"]).create_process()| 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]) |
Owner
There was a problem hiding this comment.
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()| func _init(user_args: PackedStringArray): | ||
| self.user_args = user_args | ||
|
|
||
| var _editors: LocalEditors.List |
Owner
There was a problem hiding this comment.
seems like _editors is unused here
Contributor
Author
There was a problem hiding this comment.
used in execute method to load editors
60a17bb to
a206100
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New Argument for
godotsThe new argument serves to open the last Godot project.
Usage
godots.exe [--recent or -r]