Merge pull request #30 from RothAndrew/feature/fix_issue_29

Fix bug not letting terraform_docs_replace work in the root directory…
This commit is contained in:
Anton Babenko 2018-12-15 09:40:31 +01:00 committed by GitHub
commit 3cdf8ecd62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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))
@ -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))