mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-02-22 13:15:44 -05:00
exec/file: remove_file(): use --one-file-system when recursive is requested
This commit is contained in:
parent
e758e3c343
commit
5c7ec5d0fa
1 changed files with 1 additions and 1 deletions
|
@ -138,7 +138,7 @@ def remove_file(path: str, recursive=False):
|
|||
rm = rmtree if recursive else os.unlink
|
||||
rm(path) # type: ignore
|
||||
except:
|
||||
cmd = ['rm'] + (['-r'] if recursive else []) + [path]
|
||||
cmd = ['rm', *(['-r', '--one-file-system'] if recursive else []), path]
|
||||
rc = run_root_cmd(cmd).returncode
|
||||
if rc:
|
||||
raise Exception(f"Unable to remove {path}: cmd returned {rc}")
|
||||
|
|
Loading…
Add table
Reference in a new issue