Skip to content

Commit ced8dc8

Browse files
committed
ci: improve doc generate
1 parent 3542ab3 commit ced8dc8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/doc-generate.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if [ $# -eq 0 ];then
1010
if [ -f $file/"main.tf" ];then
1111
terraform-docs $file -c scripts/.terraform-docs.yml
1212
sed -i '' 's|https://registry.terraform.io/providers/hashicorp/alicloud/latest/docs/|https://registry.terraform.io/providers/aliyun/alicloud/latest/docs/|g' $file/README.md
13-
terraform fmt $file
13+
terraform -chdir=$file fmt
1414
fi
1515
done
1616
else
@@ -19,14 +19,14 @@ else
1919
if [ -f $arg/"main.tf" ];then
2020
terraform-docs $arg -c scripts/.terraform-docs.yml
2121
sed -i '' 's|https://registry.terraform.io/providers/hashicorp/alicloud/latest/docs/|https://registry.terraform.io/providers/aliyun/alicloud/latest/docs/|g' $arg/README.md
22-
terraform fmt $file
22+
terraform -chdir=$arg fmt
2323
else
2424
exampleDir=$(find $arg -maxdepth 2 -mindepth 1 -type d)
2525
for file in $exampleDir;do
2626
if [ -f $file/"main.tf" ];then
2727
terraform-docs $file -c scripts/.terraform-docs.yml
2828
sed -i '' 's|https://registry.terraform.io/providers/hashicorp/alicloud/latest/docs/|https://registry.terraform.io/providers/aliyun/alicloud/latest/docs/|g' $file/README.md
29-
terraform fmt $file
29+
terraform -chdir=$file fmt
3030
fi
3131
done
3232
fi

0 commit comments

Comments
 (0)