forked from Mirrors/flatpak-builder
Set same environment vars in shell sources as in build
parent
db60f2d5f7
commit
f779394d92
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue