Closed BeneHa closed 2 months ago
I confirm the issue ... the sed command does not raise any error (of course) but creates a new file. @MaxymVlasov @yermulnik this is why I was saying that sed -i'' -e
(without a space before the ''
) is not working on Mac in #704.
I can confirm this behaviour:
❯ ls
tt.txt
❯ gsed -i'' -e 's/foo/foobar/' tt.txt
❯ ls
tt.txt
❯ sed -i'' -e 's/foo/foobar/' tt.txt
❯ ls
tt.txt tt.txt-e
Some useful information here about replacing strings in files: http://mywiki.wooledge.org/BashFAQ/021
tl;dr: "The preferred way to modify a file is to create a new file within the same file system, write the modified content into it, and then mv it to the original name."
I think Apply should offer $9.99/month subscription for just replacing OSX with something like ElementaryOS with some integrations top :D
If serious, please let me know is next work on Mac or not
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: aee5dc9a8d6625a47396f2b4797368c57cbb5f49
hooks:
- id: terraform_docs
Test this please
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: a76f03bfc4978741f37f79a6b4a86dc72078a78d
hooks:
- id: terraform_docs
Test this please
repos: - repo: https://github.com/antonbabenko/pre-commit-terraform rev: a76f03bfc4978741f37f79a6b4a86dc72078a78d hooks: - id: terraform_docs
Yes, it works
This issue has been resolved in version 1.94.1 :tada:
Describe the bug
Since the fix of a bug in https://github.com/antonbabenko/pre-commit-terraform/pull/704 by @cschroer , the empty sed -i flag does not work for me. Now, a
README.md-e
file is being created as well as theREADME.md
. I am using Mac's default sed.I know I can install GNU sed, but I think many users are using the default sed and will run into this issue.
How can we reproduce it?
Run pre-commit tf_docs on a Mac with the default sed installed.
Environment information
OS:
sed:
Tools availability and versions:
.pre-commit-config.yaml
:file content
```yaml repos: - repo: https://github.com/antonbabenko/pre-commit-terraform.git rev: v1.94.0 hooks: - id: terraform_docs args: - --hook-config=--create-file-if-not-exist=true ```