removes user's distro checking (done in blend) and adds exit code (which is then returned by user)
This commit is contained in:
parent
5800446122
commit
3d888de5e1
2 changed files with 2 additions and 6 deletions
6
user
6
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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue