removes user's distro checking (done in blend) and adds exit code (which is then returned by user)

This commit is contained in:
askiiart 2024-11-07 13:57:11 -06:00
parent 5800446122
commit 3d888de5e1
Signed by untrusted user who does not match committer: askiiart
GPG key ID: EA85979611654C30
2 changed files with 2 additions and 6 deletions

2
blend
View file

@ -102,7 +102,7 @@ def get_distro():
return distro_map[args.distro] return distro_map[args.distro]
except: except:
error(f"{args.distro} isn't supported by blend.") error(f"{args.distro} isn't supported by blend.")
exit() exit(1)
def list_containers(): def list_containers():

6
user
View file

@ -161,14 +161,10 @@ def create_container(container_name, distro):
''' '''
Create a container 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: 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') error(f'container {colors.bold}{container_name}{colors.reset} already exists')
exit(1) 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") @cli.command("delete-container")
@click.argument('container') @click.argument('container')