Create Fedora toolbox image based on current host machine version #1

This pull does three things, in order:

  1. Retrieves $VERSION_ID from /etc/os-release.
  2. Asserts that the $VERSION_ID matches the Fedora versioning pattern, to assure we are pulling a valid Fedora image version.
  3. Finally, uses this $VERSION_ID to create the envision container with the appropriate Fedora image version.

This should resolve issues with version mismatches, such as the recent x264 conflict, and ensure compatibility with future Fedora versions. This should address issue #13.

Changed files
+5 -1
src
atomic-xr
+5 -1
src/atomic-xr/envision.nu
···
] {
runtime install xr (if not $no_monado {"monado"})
-
distrobox create envision --no-entry -Y -i registry.fedoraproject.org/fedora-toolbox:42
+
let VERSION_ID: string = (open -r /etc/os-release | parse "{k}={v}" | str trim -c '"' | where k == VERSION_ID | get v.0)
+
+
if $VERSION_ID !~ '^\d{2}$' { error make { msg: 'VERSION_ID from /etc/os-release does not match Fedora versioning pattern.' } }
+
+
distrobox create envision --no-entry -Y -i registry.fedoraproject.org/fedora-toolbox:($VERSION_ID)
distrobox enter envision -- sudo dnf install -y nu
upgrade
log info "Successfully installed Envision"