Improve an error message

When the build directory does not exist or looks uninitialized
in flatpak build, report a helpful message that points at
flatpak build-init.
tingping/wmclass
Matthias Clasen 2016-09-24 16:04:04 -04:00
parent 636130db49
commit 0e9125619c
1 changed files with 5 additions and 1 deletions

View File

@ -116,8 +116,12 @@ flatpak_builtin_build (int argc, char **argv, GCancellable *cancellable, GError
command = argv[rest_argv_start + 1];
app_deploy = g_file_new_for_commandline_arg (directory);
metadata = g_file_get_child (app_deploy, "metadata");
if (!g_file_query_exists (app_deploy, NULL) ||
!g_file_query_exists (metadata, NULL))
return flatpak_fail (error, _("Build directory %s not initialized, use flatpak build-init"), directory);
if (!g_file_load_contents (metadata, cancellable, &metadata_contents, &metadata_size, NULL, error))
return FALSE;