immosquare-cleaner 0.1.74 → 0.1.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/immosquare-cleaner/version.rb +1 -1
- data/lib/immosquare-cleaner.rb +15 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 969ab498986c59a2c92a63cfb84c338dec84269688eb8ff5d18fadda3edc3615
|
4
|
+
data.tar.gz: b6d54676b6acdf359f1eeb6cffdcc7ebd39e11dad6504304db102085ba2ab01a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de65dff9503382b33efaff275354650aa569d36d99a80f60cecb18a63df2cc0ed557714101833dc236882eb76481ef2e8cc6658644b32140ce33cf2e70efb9a1
|
7
|
+
data.tar.gz: c1388e7a5109a04bb5c22bfed7aa14c0d99e41507369ab2a09ae3048a1f1ba82dc33d05d23bc80a1cff152c24b708d386ef7f8d7a81c4248273b273a39aa14fc
|
data/lib/immosquare-cleaner.rb
CHANGED
@@ -190,6 +190,21 @@ module ImmosquareCleaner
|
|
190
190
|
File.write(file_path, formatted_md)
|
191
191
|
File.normalize_last_line(file_path)
|
192
192
|
|
193
|
+
##============================================================##
|
194
|
+
## Shell files (.sh)
|
195
|
+
## ---------
|
196
|
+
## Uses shfmt to format shell scripts with 2-space indentation
|
197
|
+
## Checks if shfmt is available before processing
|
198
|
+
##============================================================##
|
199
|
+
elsif file_path.end_with?(".sh")
|
200
|
+
if system("which shfmt > /dev/null 2>&1")
|
201
|
+
cmds = ["shfmt -i 2 -w \"#{file_path}\""]
|
202
|
+
launch_cmds(cmds)
|
203
|
+
File.normalize_last_line(file_path)
|
204
|
+
else
|
205
|
+
puts "ERROR: shfmt is not installed. Please install it with: brew install shfmt"
|
206
|
+
end
|
207
|
+
|
193
208
|
##============================================================##
|
194
209
|
## Autres formats
|
195
210
|
##============================================================##
|