Skip to content

Commit

Permalink
sync w/ big_sur
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Golbig committed Mar 17, 2021
1 parent 779dcf3 commit 630fb89
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/generate_guidance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ def is_asciidoctor_installed():
output, error = process.communicate()

# return path to asciidoctor
return output.decode("utf-8")
return output.decode("utf-8").strip()


def is_asciidoctor_pdf_installed():
Expand All @@ -1234,7 +1234,7 @@ def is_asciidoctor_pdf_installed():
process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
output, error = process.communicate()

return output.decode("utf-8")
return output.decode("utf-8").strip()

def verify_signing_hash(hash):
"""Attempts to validate the existence of the certificate provided by the hash
Expand Down Expand Up @@ -1658,17 +1658,17 @@ def main():
asciidoctor_path = is_asciidoctor_installed()
if asciidoctor_path != "":
print('Generating HTML file from AsciiDoc...')
cmd = f"{asciidoctor_path} {adoc_output_file.name}"
process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
cmd = f"{asciidoctor_path} \'{adoc_output_file.name}\'"
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
process.communicate()
else:
print("If you would like to generate the HTML file from the AsciiDoc file, install the ruby gem for asciidoctor")

asciidoctorPDF_path = is_asciidoctor_pdf_installed()
if asciidoctorPDF_path != "":
print('Generating PDF file from AsciiDoc...')
cmd = f"{asciidoctorPDF_path} {adoc_output_file.name}"
process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
cmd = f"{asciidoctorPDF_path} \'{adoc_output_file.name}\'"
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
process.communicate()
else:
print("If you would like to generate the PDF file from the AsciiDoc file, install the ruby gem for asciidoctor-pdf")
Expand Down

0 comments on commit 630fb89

Please sign in to comment.