mirror of
https://github.com/flatpak/flatpak.git
synced 2026-05-24 16:57:42 -04:00
install: Make --from and --bundle optional
If the first argument has the right extension we just assume you want to install from it. This fixes https://github.com/flatpak/flatpak/issues/429 and https://github.com/flatpak/flatpak/issues/415
This commit is contained in:
@@ -130,6 +130,8 @@ install_bundle (FlatpakDir *dir,
|
||||
|
||||
file = g_file_new_for_commandline_arg (filename);
|
||||
|
||||
if (!g_file_is_native (file))
|
||||
return flatpak_fail (error, _("Remote bundles are not supported"));
|
||||
|
||||
if (opt_gpg_file != NULL)
|
||||
{
|
||||
@@ -370,6 +372,14 @@ flatpak_builtin_install (int argc, char **argv, GCancellable *cancellable, GErro
|
||||
if (!flatpak_option_context_parse (context, options, &argc, &argv, 0, &dir, cancellable, error))
|
||||
return FALSE;
|
||||
|
||||
if (!opt_bundle && !opt_from && !opt_oci && argc >= 2)
|
||||
{
|
||||
if (g_str_has_suffix (argv[1], ".flatpakref"))
|
||||
opt_from = TRUE;
|
||||
if (g_str_has_suffix (argv[1], ".flatpak"))
|
||||
opt_bundle = TRUE;
|
||||
}
|
||||
|
||||
if (opt_bundle)
|
||||
return install_bundle (dir, context, argc, argv, cancellable, error);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user