Use temp dirs instead of cache dirs for export

Fixes #95897
During CI scenarios $HOME may be set to an invalid value (such as
`/var/empty`).
Using temp dirs fits better with godot's usage of these paths and is
independent from the user's $HOME.
This commit is contained in:
ArchercatNEO 2024-12-07 17:31:22 +00:00
parent aa8d9b83f6
commit 00a791f04e
9 changed files with 36 additions and 36 deletions

View file

@ -88,7 +88,7 @@ Error EditorExportPlatformLinuxBSD::export_project(const Ref<EditorExportPreset>
// Setup temp folder.
String path = p_path;
String tmp_dir_path = EditorPaths::get_singleton()->get_cache_dir().path_join(pkg_name);
String tmp_dir_path = EditorPaths::get_singleton()->get_temp_dir().path_join(pkg_name);
Ref<DirAccess> tmp_app_dir = DirAccess::create_for_path(tmp_dir_path);
if (export_as_zip) {
@ -468,7 +468,7 @@ Error EditorExportPlatformLinuxBSD::run(const Ref<EditorExportPreset> &p_preset,
EditorProgress ep("run", TTR("Running..."), 5);
const String dest = EditorPaths::get_singleton()->get_cache_dir().path_join("linuxbsd");
const String dest = EditorPaths::get_singleton()->get_temp_dir().path_join("linuxbsd");
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
if (!da->dir_exists(dest)) {
Error err = da->make_dir_recursive(dest);