machines delete: fix - delete all existing files
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import argparse
|
import argparse
|
||||||
|
import shutil
|
||||||
|
|
||||||
from ..errors import ClanError
|
from ..errors import ClanError
|
||||||
from .folders import machine_folder
|
from .folders import machine_folder
|
||||||
@@ -7,7 +8,7 @@ from .folders import machine_folder
|
|||||||
def delete_command(args: argparse.Namespace) -> None:
|
def delete_command(args: argparse.Namespace) -> None:
|
||||||
folder = machine_folder(args.host)
|
folder = machine_folder(args.host)
|
||||||
if folder.exists():
|
if folder.exists():
|
||||||
folder.rmdir()
|
shutil.rmtree(folder)
|
||||||
else:
|
else:
|
||||||
raise ClanError(f"Machine {args.host} does not exist")
|
raise ClanError(f"Machine {args.host} does not exist")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user