mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-22 02:45:10 -04:00
ensure correct permissions for archived items
This commit is contained in:
parent
f4c0616332
commit
9cb0be183b
2 changed files with 14 additions and 2 deletions
archivebox
|
@ -53,8 +53,12 @@ def chmod_file(path: str, cwd: str='.', permissions: str=OUTPUT_PERMISSIONS) ->
|
|||
if not root.exists():
|
||||
raise Exception('Failed to chmod: {} does not exist (did the previous step fail?)'.format(path))
|
||||
|
||||
for subpath in Path(path).glob('**/*'):
|
||||
os.chmod(subpath, int(OUTPUT_PERMISSIONS, base=8))
|
||||
if not root.is_dir():
|
||||
os.chmod(root, int(OUTPUT_PERMISSIONS, base=8))
|
||||
else:
|
||||
for subpath in Path(path).glob('**/*'):
|
||||
print("THE PATH TO MODIFY IS", subpath)
|
||||
os.chmod(subpath, int(OUTPUT_PERMISSIONS, base=8))
|
||||
|
||||
|
||||
@enforce_types
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue