fix: make $output/all directory

one must not assume
This commit is contained in:
ptrcnull 2024-04-07 11:39:19 +02:00
parent c1e0b04122
commit b28bab5b3e

View file

@ -1,4 +1,5 @@
import argparse
from genericpath import exists
import logging
import os.path
import shutil
@ -75,8 +76,11 @@ def main() -> None:
shutil.chown(domain_key, 'acme', 'acme')
domain_key.chmod(0o440)
all_pem = output_dir / 'all' / f'{domain}.pem'
all_key = output_dir / 'all' / f'{domain}.pem.key'
all_dir = output_dir / 'all'
all_dir.mkdir(parents=True, exists_ok=True)
all_pem = all_dir / f'{domain}.pem'
all_key = all_dir / f'{domain}.pem.key'
all_pem.unlink(missing_ok=True)
all_pem.hardlink_to(domain_pem)