Set same environment vars in shell sources as in build

tingping/wmclass
Alexander Larsson 2017-09-06 19:20:49 +02:00
parent db60f2d5f7
commit f779394d92
1 changed files with 9 additions and 0 deletions

View File

@ -124,8 +124,11 @@ run_script (BuilderContext *context,
g_autofree char *source_dir_path_canonical = NULL;
g_autoptr(GFile) source_dir_path_canonical_file = NULL;
g_auto(GStrv) build_args = NULL;
g_auto(GStrv) env = NULL;
int i;
env = builder_options_get_env (build_options, context);
args = g_ptr_array_new_with_free_func (g_free);
g_ptr_array_add (args, g_strdup ("flatpak"));
g_ptr_array_add (args, g_strdup ("build"));
@ -136,6 +139,12 @@ run_script (BuilderContext *context,
g_ptr_array_add (args, g_strdup ("--nofilesystem=host"));
g_ptr_array_add (args, g_strdup_printf ("--filesystem=%s", source_dir_path_canonical));
if (env)
{
for (i = 0; env[i] != NULL; i++)
g_ptr_array_add (args, g_strdup_printf ("--env=%s", env[i]));
}
build_args = builder_options_get_build_args (build_options, context, error);
if (build_args == NULL)
return FALSE;