lib/wp: add a new search folder to locate the Lua Test scripts

This commit is contained in:
Ashok Sidipotu
2022-11-25 06:51:04 +05:30
committed by Julian Bouzas
parent e23964c94b
commit fcfae4eeb3
5 changed files with 13 additions and 5 deletions

View File

@@ -41,6 +41,7 @@ wp_lua_scripting_package_searcher (lua_State *L)
g_autoptr (GError) error = NULL;
g_autofree gchar *filename = g_strdup_printf ("%s.lua", name);
g_autofree gchar *script = wp_find_file (
WP_LOOKUP_DIR_ENV_TEST_SRCDIR |
WP_LOOKUP_DIR_ENV_DATA |
WP_LOOKUP_DIR_XDG_CONFIG_HOME |
WP_LOOKUP_DIR_ETC |
@@ -166,7 +167,9 @@ find_script (const gchar * script, WpCore *core)
g_file_test (script, G_FILE_TEST_IS_REGULAR))
return g_strdup (script);
return wp_find_file (WP_LOOKUP_DIR_ENV_DATA |
WP_LOOKUP_DIR_ENV_TEST_SRCDIR |
WP_LOOKUP_DIR_XDG_CONFIG_HOME |
WP_LOOKUP_DIR_ETC |
WP_LOOKUP_DIR_PREFIX_SHARE,