fix: remove sed postprocessing from the terraform_docs_replace hook to fix compatibility with terraform-docs 0.11.0+ (#176)

This commit is contained in:
chopped pork 2021-02-25 19:46:51 +00:00 committed by GitHub
commit 90d45213a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -29,7 +29,7 @@ def main(argv=None):
dirs = []
for filename in args.filenames:
if (os.path.realpath(filename) not in dirs and \
if (os.path.realpath(filename) not in dirs and
(filename.endswith(".tf") or filename.endswith(".tfvars"))):
dirs.append(os.path.dirname(filename))
@ -43,9 +43,8 @@ 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('>')
procArgs.append("./{dir}/{dest}".format(dir=dir,dest=args.dest))
procArgs.append("./{dir}/{dest}".format(dir=dir, dest=args.dest))
subprocess.check_call(" ".join(procArgs), shell=True)
except subprocess.CalledProcessError as e:
print(e)