mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-06 09:20:57 +01:00
fix news and move force logic out of try
This commit is contained in:
parent
3fef5198c8
commit
e47633acb2
2 changed files with 5 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
**Added:**
|
||||
|
||||
* ``xonsh.lib.rmtree()`` an rmtree which works on windows properly (even with
|
||||
* ``xonsh.lib.os.rmtree()`` an rmtree which works on windows properly (even with
|
||||
git)
|
||||
|
||||
**Changed:** None
|
||||
|
|
|
@ -24,11 +24,11 @@ def rmtree(dirname, force=False):
|
|||
force : bool
|
||||
If True force removal, defaults to False
|
||||
"""
|
||||
cmd_args = '-r'
|
||||
if force:
|
||||
cmd_args += 'f'
|
||||
try:
|
||||
if force:
|
||||
rm -rf @(dirname)
|
||||
else:
|
||||
rm -r @(dirname)
|
||||
rm @(cmd_args) @(dirname)
|
||||
except PermissionError:
|
||||
if sys.platform == "win32":
|
||||
del /F/S/Q @(dirname)
|
||||
|
|
Loading…
Add table
Reference in a new issue