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:
parent
a698027199
commit
1bee46abe6
1 changed files with 4 additions and 0 deletions
|
@ -190,5 +190,9 @@ def write_bibliography(api: PaperLibraryAPI, config: Config, tag: str = None):
|
||||||
dir = config.basedir_path
|
dir = config.basedir_path
|
||||||
bib = api.fetch_bibliography(tag)
|
bib = api.fetch_bibliography(tag)
|
||||||
target_file = dir / "bibliography.bib"
|
target_file = dir / "bibliography.bib"
|
||||||
|
if target_file.exists():
|
||||||
|
target_file.chmod(0o644)
|
||||||
with target_file.open("w") as f:
|
with target_file.open("w") as f:
|
||||||
f.write(bib)
|
f.write(bib)
|
||||||
|
target_file.chmod(0o444)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue