File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 825825 NSString *nsappname = [[[NSBundle mainBundle ] infoDictionary ] objectForKey: @" CFBundleName" ];
826826 if (nsappname != nil ) {
827827 String path = String::utf8 ([[[NSBundle mainBundle ] bundlePath ] UTF8String ]);
828+ #ifdef TOOLS_ENABLED
829+ if (Engine::get_singleton () && !Engine::get_singleton ()->is_project_manager_hint () && !Engine::get_singleton ()->is_editor_hint ()) {
830+ // Project started from the editor, inject "path" argument to set instance working directory.
831+ char cwd[PATH_MAX];
832+ if (::getcwd (cwd, sizeof (cwd)) != nullptr ) {
833+ List<String> arguments = p_arguments;
834+ arguments.push_back (" --path" );
835+ arguments.push_back (String::utf8 (cwd));
836+ return create_process (path, arguments, r_child_id, false );
837+ }
838+ }
839+ #endif
828840 return create_process (path, p_arguments, r_child_id, false );
829841 } else {
830842 return create_process (get_executable_path (), p_arguments, r_child_id, false );
You can’t perform that action at this time.
0 commit comments