diff options
author | Alexander Larsson <alexl@redhat.com> | 2016-04-14 18:26:22 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2016-04-14 18:26:22 +0200 |
commit | 29a7e0459e35cca7ba9da5632dd6874acb0ffee5 (patch) | |
tree | 183e24d21ad07e328c8bf90d75bc308333212e71 /app | |
parent | 8d4393a7aabc9315f1de038e2bd109ca555b35a7 (diff) | |
download | xdg-app-29a7e0459e35cca7ba9da5632dd6874acb0ffee5.tar.gz |
run: Use the current version by default
Diffstat (limited to 'app')
-rw-r--r-- | app/xdg-app-builtins-run.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/app/xdg-app-builtins-run.c b/app/xdg-app-builtins-run.c index b9c0422..9f5c898 100644 --- a/app/xdg-app-builtins-run.c +++ b/app/xdg-app-builtins-run.c @@ -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) |