diff --git a/src/atomic-xr/envision.nu b/src/atomic-xr/envision.nu index b73b152..faf8851 100644 --- a/src/atomic-xr/envision.nu +++ b/src/atomic-xr/envision.nu @@ -22,14 +22,18 @@ export def uninstall [] { def ensure-host-packages [ ...packages: string ] { - $packages + let missing_packages = $packages | each {|package| if (rpm -q $package | complete | get exit_code) != 0 { - rpm-ostree install $package - # TODO: Notification actions - notify-send -u critical $"`($package)` installed" "Please reboot or use `rpm-ostree ex apply-live` before attempting to launch Envision." + $package } } + + if ($missing_packages | is-not-empty) { + rpm-ostree install ...$missing_packages + # TODO: Notification actions + notify-send -u critical "Package(s) installed" "Please reboot or use `rpm-ostree ex apply-live` before attempting to launch Envision." + } } export def upgrade [] {