mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Add error message when trying to load project from CWD.
This commit is contained in:
parent
8deb221829
commit
a7358ddd12
7 changed files with 43 additions and 2 deletions
|
|
@ -1096,6 +1096,16 @@ Error OS_Unix::set_cwd(const String &p_cwd) {
|
|||
return OK;
|
||||
}
|
||||
|
||||
String OS_Unix::get_cwd() const {
|
||||
String dir;
|
||||
char real_current_dir_name[2048];
|
||||
ERR_FAIL_NULL_V(getcwd(real_current_dir_name, 2048), ".");
|
||||
if (dir.append_utf8(real_current_dir_name) != OK) {
|
||||
dir = real_current_dir_name;
|
||||
}
|
||||
return dir;
|
||||
}
|
||||
|
||||
bool OS_Unix::has_environment(const String &p_var) const {
|
||||
return getenv(p_var.utf8().get_data()) != nullptr;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue