mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 03:31:36 +01:00
build-doc: exit 1 on error, add to release testing
This commit is contained in:
40
build-doc
40
build-doc
@@ -1,2 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
asciidoctor -o out/README.html -v README.adoc
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import re
|
||||
|
||||
import common
|
||||
from shell_helpers import LF
|
||||
|
||||
class Main(common.LkmcCliFunction):
|
||||
def __init__(self):
|
||||
super().__init__(
|
||||
defaults = {
|
||||
'print_time': False,
|
||||
},
|
||||
description='''\
|
||||
https://github.com/cirosantilli/linux-kernel-module-cheat#build-the-documentation
|
||||
''',
|
||||
)
|
||||
|
||||
def timed_main(self):
|
||||
self.sh.run_cmd(
|
||||
[
|
||||
'asciidoctor', LF,
|
||||
'-o', self.env['readme_out'], LF,
|
||||
'-v', self.env['readme'], LF,
|
||||
],
|
||||
out_file=self.env['build_doc_log'],
|
||||
)
|
||||
error_re = re.compile('^asciidoctor: WARNING: ')
|
||||
exit_status = 0
|
||||
with open(self.env['build_doc_log']) as f:
|
||||
for line in f:
|
||||
if error_re.search(line):
|
||||
exit_status = 1
|
||||
break
|
||||
return exit_status
|
||||
|
||||
if __name__ == '__main__':
|
||||
Main().cli()
|
||||
|
||||
Reference in New Issue
Block a user