Skip to content
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

Clarify get_executable_path documentation for Mac #93944

Merged
merged 1 commit into from
Jul 7, 2024

Conversation

AdamLearns
Copy link
Contributor

This page of the documentation has the following blurb:

String get_executable_path ( ) const

Returns the path to the current engine executable.

Note: On macOS, always use create_instance instead of relying on executable path.

This makes it sound like it's wrong to ever use get_executable_path on macOS, but it's actually only if you're attempting to launch another instance of Godot that you should opt for create_instance. If you're instead doing something like trying to resolve res://, it seems like it's okay to use get_executable_path.

@AdamLearns AdamLearns requested a review from a team as a code owner July 4, 2024 16:37
@AThousandShips AThousandShips added enhancement documentation cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Jul 4, 2024
@AThousandShips AThousandShips added this to the 4.x milestone Jul 4, 2024
Copy link
Contributor

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

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

In #80282 this line went unchanged due to severe lack of context, so I heavily appreciate this. Wording matches that prior PR, too.

The prior line was written by by @bruvzg 3 years ago.

@Mickeon Mickeon requested a review from bruvzg July 4, 2024 16:46
@Mickeon
Copy link
Contributor

Mickeon commented Jul 5, 2024

Would be nice if both the commit and the title of this PR were more self-explanatory, by the way.

@AdamLearns AdamLearns changed the title Clarify documentation Clarify get_executable_path documentation for Mac Jul 5, 2024
@AdamLearns
Copy link
Contributor Author

Would be nice if both the commit and the title of this PR were more self-explanatory, by the way.

I've updated both. 👍

@bruvzg
Copy link
Member

bruvzg commented Jul 5, 2024

If you're instead doing something like trying to resolve res://, it seems like it's okay to use get_executable_path.

That's bad example, you should use ProjectSettings.globalize_path(path) to resolve res:// and similar path. But in general, get_executable_path is good to use if you want an executable path (or path of something relative to executable).

@akien-mga akien-mga changed the title Clarify get_executable_path documentation for Mac Clarify get_executable_path documentation for Mac Jul 7, 2024
@akien-mga akien-mga modified the milestones: 4.x, 4.3 Jul 7, 2024
@akien-mga akien-mga removed cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release labels Jul 7, 2024
@akien-mga akien-mga merged commit dc34cb0 into godotengine:master Jul 7, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

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

Successfully merging this pull request may close these issues.

5 participants