mirror of
https://github.com/usnistgov/macos_security.git
synced 2026-02-03 14:03:24 +00:00
added ruby gem changes
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,3 +1,6 @@
|
||||
.DS_Store
|
||||
.vscode
|
||||
*.lock
|
||||
*.lock
|
||||
.bundle
|
||||
bin
|
||||
mscp_gems
|
||||
|
||||
@@ -1415,6 +1415,7 @@ def create_args():
|
||||
help="sign the configuration profiles with subject key ID (hash value without spaces)")
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def is_asciidoctor_installed():
|
||||
"""Checks to see if the ruby gem for asciidoctor is installed
|
||||
"""
|
||||
@@ -1928,10 +1929,21 @@ def main():
|
||||
cmd = f"{asciidoctor_path} \'{adoc_output_file.name}\'"
|
||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
|
||||
process.communicate()
|
||||
elif os.path.exists('../bin/asciidoctor'):
|
||||
print('Generating HTML file from AsciiDoc...')
|
||||
cmd = f"'../bin/asciidoctor' \'{adoc_output_file.name}\'"
|
||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
|
||||
process.communicate()
|
||||
elif not os.path.exists('../bin/asciidoctor'):
|
||||
print('Installing gem requirements - asciidoctor, asciidoctor-pdf, and rouge...')
|
||||
cmd = ['/usr/bin/bundle', 'install', '--gemfile', '../Gemfile', '--binstubs', '--path', 'mscp_gems']
|
||||
subprocess.run(cmd)
|
||||
print('Generating HTML file from AsciiDoc...')
|
||||
cmd = f"'../bin/asciidoctor' \'{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()
|
||||
print("If you would like to generate the PDF file from the AsciiDoc file, install the ruby gem for asciidoctor")
|
||||
|
||||
# Don't create PDF if we are generating SCAP
|
||||
if not args.gary:
|
||||
@@ -1941,6 +1953,11 @@ def main():
|
||||
cmd = f"{asciidoctorPDF_path} \'{adoc_output_file.name}\'"
|
||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
|
||||
process.communicate()
|
||||
elif os.path.exists('../bin/asciidoctor-pdf'):
|
||||
print('Generating PDF file from AsciiDoc...')
|
||||
cmd = f"'../bin/asciidoctor-pdf' \'{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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user