Skip to content

Commit

Permalink
Add slash to mktemp dir (fixed #50)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbabenko committed Jun 18, 2019
1 parent 59ffa65 commit c9ecd72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions terraform_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ main() {
if [[ "$hack_terraform_docs" == "1" ]]; then
which awk 2>&1 >/dev/null || ( echo "awk is required for terraform-docs hack to work with Terraform 0.12"; exit 1)

tmp_file_awk=$(mktemp "${TMPDIR:-/tmp}terraform-docs-XXXXXXXXXX")
tmp_file_awk=$(mktemp "${TMPDIR:-/tmp}/terraform-docs-XXXXXXXXXX")
terraform_docs_awk "$tmp_file_awk"
terraform_docs "$tmp_file_awk" "$args" "$files"
rm -f "$tmp_file_awk"
Expand Down Expand Up @@ -79,7 +79,7 @@ terraform_docs() {
terraform-docs $args md ./ > "$tmp_file"
else
# Can't append extension for mktemp, so renaming instead
tmp_file_docs=$(mktemp "${TMPDIR:-/tmp}terraform-docs-XXXXXXXXXX")
tmp_file_docs=$(mktemp "${TMPDIR:-/tmp}/terraform-docs-XXXXXXXXXX")
mv "$tmp_file_docs" "$tmp_file_docs.tf"
tmp_file_docs_tf="$tmp_file_docs.tf"

Expand Down

0 comments on commit c9ecd72

Please sign in to comment.