mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-06-25 09:58:21 -04:00
use exec.file.{root_write_file,remove_file} where appropiate
This commit is contained in:
parent
9d24065258
commit
cc29b60f9f
6 changed files with 32 additions and 22 deletions
12
cache.py
12
cache.py
|
@ -1,10 +1,11 @@
|
|||
import shutil
|
||||
import click
|
||||
import os
|
||||
from config import config
|
||||
from wrapper import enforce_wrap
|
||||
import logging
|
||||
|
||||
from config import config
|
||||
from exec.file import remove_file
|
||||
from wrapper import enforce_wrap
|
||||
|
||||
PATHS = ['chroots', 'pacman', 'jumpdrive', 'packages', 'images']
|
||||
|
||||
|
||||
|
@ -37,7 +38,4 @@ def cmd_clean(paths: list[str], force=False):
|
|||
for file in os.listdir(dir):
|
||||
path = os.path.join(dir, file)
|
||||
logging.debug(f'Removing "{path_name}/{file}"')
|
||||
if os.path.isdir(path):
|
||||
shutil.rmtree(path)
|
||||
else:
|
||||
os.unlink(path)
|
||||
remove_file(path, recursive=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue