1
0
Fork 0
mirror of https://github.com/Findus23/PaperLibrary-cli.git synced 2024-09-20 17:03:46 +02:00

make bib files read-only

This commit is contained in:
Lukas Winkler 2023-08-08 11:11:40 +02:00
parent a698027199
commit 1bee46abe6
Signed by: lukas
GPG key ID: 54DE4D798D244853

View file

@ -190,5 +190,9 @@ def write_bibliography(api: PaperLibraryAPI, config: Config, tag: str = None):
dir = config.basedir_path
bib = api.fetch_bibliography(tag)
target_file = dir / "bibliography.bib"
if target_file.exists():
target_file.chmod(0o644)
with target_file.open("w") as f:
f.write(bib)
target_file.chmod(0o444)