build-release-notes: fail if the directory does not exist
This was a combination of two problems: the python didn't throw an error
because apparently glob on a nonexistent directory doesn't crash, and
secondarily, bash ignores bad exit codes without `set -e` if they are
not in the final/only command.
Change-Id: I812bde7a4daee5c77ffe9d7c73a25fd14969f548
This commit is contained in:
parent
f6397cc286
commit
03655c310d
|
@ -1,6 +1,8 @@
|
||||||
rl_next_generated = custom_target(
|
rl_next_generated = custom_target(
|
||||||
command : [
|
command : [
|
||||||
'bash',
|
'bash',
|
||||||
|
'-euo',
|
||||||
|
'pipefail',
|
||||||
'-c',
|
'-c',
|
||||||
'''
|
'''
|
||||||
if type -p build-release-notes > /dev/null; then
|
if type -p build-release-notes > /dev/null; then
|
||||||
|
|
|
@ -40,7 +40,10 @@ def plural_list(strs: list[str]) -> str:
|
||||||
return '{}{} and {}'.format(', '.join(strs[:-1]), comma, strs[-1])
|
return '{}{} and {}'.format(', '.join(strs[:-1]), comma, strs[-1])
|
||||||
|
|
||||||
def run_on_dir(d):
|
def run_on_dir(d):
|
||||||
paths = pathlib.Path(d).glob('*.md')
|
d = pathlib.Path(d)
|
||||||
|
if not d.is_dir():
|
||||||
|
raise ValueError(f'provided path {d} is not a directory')
|
||||||
|
paths = d.glob('*.md')
|
||||||
entries = []
|
entries = []
|
||||||
for p in paths:
|
for p in paths:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue