immosquare-cleaner 0.1.74 → 0.1.76
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 +18 -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: e15be9a3bb8efbbe08399d5bb73f355eaad049e30b78785ba8259ebb7355ec37
|
4
|
+
data.tar.gz: 81ba7269dc35c045b3339a2903be46e7bb827ef09defce8eb9d615e625d0967c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4000da3a2e542830dd2e5964d421099480d95bc7bc5f6380dba01f99d59f1c90af0fad4cedab107723b58fd217b720ad6cc8cdf34b55203a2715c1dc77f9d531
|
7
|
+
data.tar.gz: b04f1e509f1c17cec60f606d6f6dffcf0d6d7e4942ced834ca113afcee77d09eec8594345904dca41103dd8e5e2c19947d4c224ca7f8ea8c0d097c36f548e233
|
data/lib/immosquare-cleaner.rb
CHANGED
@@ -190,6 +190,24 @@ 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) and other shell files
|
195
|
+
## (Attention : certains fichiers peuvent ne pas avoir de point devant,
|
196
|
+
## car ils sont parfois utilisés comme liens symboliques synchronisés ou fichiers de config globaux.)
|
197
|
+
## Ne pas inclure de fichiers non shell (ex: fish, csh, tcsh) car shfmt ne les supporte pas.
|
198
|
+
## ---------
|
199
|
+
## Uses shfmt to format shell scripts with 2-space indentation
|
200
|
+
## Checks if shfmt is available before processing
|
201
|
+
##============================================================##
|
202
|
+
elsif file_path.end_with?(".sh", "bash", "zsh", "zshrc", "bashrc", "bash_profile", "zprofile")
|
203
|
+
if system("which shfmt > /dev/null 2>&1")
|
204
|
+
cmds = ["shfmt -i 2 -w \"#{file_path}\""]
|
205
|
+
launch_cmds(cmds)
|
206
|
+
File.normalize_last_line(file_path)
|
207
|
+
else
|
208
|
+
puts("ERROR: shfmt is not installed. Please install it with: brew install shfmt")
|
209
|
+
end
|
210
|
+
|
193
211
|
##============================================================##
|
194
212
|
## Autres formats
|
195
213
|
##============================================================##
|