run: Use the current version by default

tingping/wmclass
Alexander Larsson 2016-04-14 18:26:22 +02:00
parent 8d4393a7aa
commit 29a7e0459e
1 changed files with 15 additions and 2 deletions

View File

@ -93,9 +93,22 @@ xdg_app_builtin_run (int argc, char **argv, GCancellable *cancellable, GError **
if (opt_branch)
branch = opt_branch;
app_ref = xdg_app_compose_ref (TRUE, app, branch, opt_arch, error);
if (opt_branch == NULL && opt_arch == NULL)
{
g_autoptr(XdgAppDir) user_dir = xdg_app_dir_get_user ();
g_autoptr(XdgAppDir) system_dir = xdg_app_dir_get_system ();
app_ref = xdg_app_dir_current_ref (user_dir, app, cancellable);
if (app_ref == NULL)
app_ref = xdg_app_dir_current_ref (system_dir, app, cancellable);
}
if (app_ref == NULL)
return FALSE;
{
app_ref = xdg_app_compose_ref (TRUE, app, branch, opt_arch, error);
if (app_ref == NULL)
return FALSE;
}
app_deploy = xdg_app_find_deploy_for_ref (app_ref, cancellable, error);
if (app_deploy == NULL)