Skip to content

Commit

Permalink
Fix autoload error & Nindot.Tests race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Amethyst-szs committed Jan 13, 2025
1 parent 20d8461 commit 3327537
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 0 additions & 4 deletions MoonFlow/addons/git_database/plugin/plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ var tools: Dictionary = {

func _enter_tree():
# Setup export plugin
var n := "GitInfoSingletonRegisterUtility"
if !ProjectSettings.has_setting("autoload/" + n):
add_autoload_singleton(n, "res://addons/git_database/plugin/instance_register.gd")

add_export_plugin(export_handler)

# Setup tool menu
Expand Down
11 changes: 11 additions & 0 deletions Nindot.Tests/PathUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,16 @@ private class Data
}

private static Data Instance = null;
private static bool IsInvalidInstanceData = false;

private static string GetPath(string key)
{
if (IsInvalidInstanceData)
{
Assert.Skip("No path provided for test requiring " + key);
return null;
}

if (Instance == null)
InstantiateData();

Expand Down Expand Up @@ -85,9 +92,13 @@ private static void InstantiateData()
const string path = "../../../GamePaths.json";
const string template = "../../../Resources/GamePathTemplate.json";

if (IsInvalidInstanceData)
return;

// Attempt to access json
if (!File.Exists(path))
{
IsInvalidInstanceData = true;
File.Copy(template, path);

const string errStr = "\n\n - MISSING GAME PATHS - \n\n go to Nindot.Tests/GamePaths.json and add your game paths!";
Expand Down

0 comments on commit 3327537

Please sign in to comment.