Skip to content

Commit

Permalink
Fix bug not letting terraform_docs_replace work in the root directory…
Browse files Browse the repository at this point in the history
… of a repo
  • Loading branch information
RothAndrew committed Dec 14, 2018
1 parent a52b507 commit 15c9f39
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pre_commit_hooks/terraform_docs_replace.py
Expand Up @@ -25,7 +25,6 @@ def main(argv=None):
dirs = []
for filename in args.filenames:
if (os.path.realpath(filename) not in dirs and \
len(os.path.realpath(filename).strip()) > 0 and \
(filename.endswith(".tf") or filename.endswith(".tfvars"))):
dirs.append(os.path.dirname(filename))

Expand All @@ -40,7 +39,7 @@ def main(argv=None):
if args.aggregate:
procArgs.append('--with-aggregate-type-defaults')
procArgs.append('md')
procArgs.append(dir)
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))
Expand Down

0 comments on commit 15c9f39

Please sign in to comment.