Skip to content

Commit

Permalink
fix: trailing line pattern should only delete empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
choppedpork committed Feb 25, 2021
1 parent f189a11 commit 733a8f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pre_commit_hooks/terraform_docs_replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def main(argv=None):
procArgs.append('--sort-by-required')
procArgs.append('md')
procArgs.append("./{dir}".format(dir=dir))
procArgs.append("| sed -e '$ d' -e 'N;/^\\n$/D;P;D'")
procArgs.append("| sed -e '${/^$/d;}' -e 'N;/^\\n$/D;P;D'")
procArgs.append('>')
procArgs.append("./{dir}/{dest}".format(dir=dir,dest=args.dest))
subprocess.check_call(" ".join(procArgs), shell=True)
Expand Down

0 comments on commit 733a8f0

Please sign in to comment.