From 3d888de5e132dca65481131a1a86a161ff7bda6f Mon Sep 17 00:00:00 2001 From: askiiart Date: Thu, 7 Nov 2024 13:57:11 -0600 Subject: [PATCH] removes user's distro checking (done in blend) and adds exit code (which is then returned by user) --- blend | 2 +- user | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/blend b/blend index d6df431..bc50db5 100755 --- a/blend +++ b/blend @@ -102,7 +102,7 @@ def get_distro(): return distro_map[args.distro] except: error(f"{args.distro} isn't supported by blend.") - exit() + exit(1) def list_containers(): diff --git a/user b/user index ed8d6a4..2b519c6 100755 --- a/user +++ b/user @@ -161,14 +161,10 @@ def create_container(container_name, distro): ''' Create a container ''' - if distro not in ('arch', 'almalinux-9', 'crystal-linux', 'debian', 'fedora-38', 'kali-linux', 'neurodebian-bookworm', 'rocky-linux', 'ubuntu-22.04', 'ubuntu-23.04'): - error( - f'distro {colors.bold}{distro}{colors.reset} not supported') if subprocess.run(['podman', 'container', 'exists', container_name], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode == 0: error(f'container {colors.bold}{container_name}{colors.reset} already exists') exit(1) - subprocess.run(['blend', 'create-container', '-cn', container_name, '-d', distro]) - + exit(subprocess.run(['blend', 'create-container', '-cn', container_name, '-d', distro]).returncode) @cli.command("delete-container") @click.argument('container')