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 os
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
DOCUMENTS = [
|
DOCUMENTS = [
|
||||||
('document', 'mémoire'),
|
('document', 'mémoire'),
|
||||||
|
@ -20,7 +21,7 @@ def errun(command):
|
||||||
command, stderr=subprocess.STDOUT)
|
command, stderr=subprocess.STDOUT)
|
||||||
|
|
||||||
|
|
||||||
def build():
|
def build(sign):
|
||||||
for en, fr in DOCUMENTS:
|
for en, fr in DOCUMENTS:
|
||||||
command = ['xelatex',
|
command = ['xelatex',
|
||||||
'-output-directory', TMP,
|
'-output-directory', TMP,
|
||||||
|
@ -40,6 +41,7 @@ def build():
|
||||||
run(command)
|
run(command)
|
||||||
os.rename(os.path.join(TMP, f'{en}.pdf'),
|
os.rename(os.path.join(TMP, f'{en}.pdf'),
|
||||||
os.path.join(TMP, f'{fr}.pdf'))
|
os.path.join(TMP, f'{fr}.pdf'))
|
||||||
|
if sign:
|
||||||
pdf = f'{fr}.pdf'
|
pdf = f'{fr}.pdf'
|
||||||
run(['gpg',
|
run(['gpg',
|
||||||
'--armor',
|
'--armor',
|
||||||
|
@ -75,7 +77,7 @@ def main():
|
||||||
os.chdir(directory)
|
os.chdir(directory)
|
||||||
clean()
|
clean()
|
||||||
os.makedirs(TMP)
|
os.makedirs(TMP)
|
||||||
build()
|
build(len(sys.argv) == 1)
|
||||||
clean()
|
clean()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue