build/sign
This commit is contained in:
parent
6e92d619fa
commit
d505187624
1 changed files with 27 additions and 25 deletions
|
@ -3,6 +3,7 @@
|
|||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
DOCUMENTS = [
|
||||
('document', 'mémoire'),
|
||||
|
@ -20,7 +21,7 @@ def errun(command):
|
|||
command, stderr=subprocess.STDOUT)
|
||||
|
||||
|
||||
def build():
|
||||
def build(sign):
|
||||
for en, fr in DOCUMENTS:
|
||||
command = ['xelatex',
|
||||
'-output-directory', TMP,
|
||||
|
@ -40,6 +41,7 @@ def build():
|
|||
run(command)
|
||||
os.rename(os.path.join(TMP, f'{en}.pdf'),
|
||||
os.path.join(TMP, f'{fr}.pdf'))
|
||||
if sign:
|
||||
pdf = f'{fr}.pdf'
|
||||
run(['gpg',
|
||||
'--armor',
|
||||
|
@ -75,7 +77,7 @@ def main():
|
|||
os.chdir(directory)
|
||||
clean()
|
||||
os.makedirs(TMP)
|
||||
build()
|
||||
build(len(sys.argv) == 1)
|
||||
clean()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue