fastlane-plugin-number_of_swift_lines 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 733ca26cf1963a90e2b3580a3b96f8a44c256dd5
|
4
|
+
data.tar.gz: 151a4113ae59818dd422647b4a85b1313ce9293a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8ac1673632a5bbcc38669a3c7084315797fed3b7535d968261b7cdf51c651b1d4f7eb4e9d6378e2b8dc596f9ecc7ceb3d223fbe955b064adc324f45f14e67a0
|
7
|
+
data.tar.gz: 1f55ec195461f5e7a77acae8484b712d42e26ff1d5d6baae70d3f857f4d9f11ccd5f2d23d156e6bbd84938d2cf888ed5a8258f5cc693053d338fd0a63c9cccda
|
@@ -14,17 +14,21 @@ module Fastlane
|
|
14
14
|
show_ascii = params[:enable_ascii_art]
|
15
15
|
exclude_regex = params[:files_exclude_regex]
|
16
16
|
|
17
|
-
current_dir = Dir.pwd
|
18
|
-
|
17
|
+
current_dir = Dir.pwd #//TODO:change to project root dir, relative path!
|
18
|
+
find_command = "find #{current_dir} -name \"*.swift\" | egrep -v \"#{exclude_regex}\""
|
19
|
+
#find_command = "find . -name '*.swift' -not -path '*/Tests/*' -not -path '*/Pods/*' -not -path '*/Carthage/*' -print0"
|
20
|
+
UI.message(find_command)
|
21
|
+
|
22
|
+
swift_files = `#{find_command}`
|
19
23
|
if swift_files.empty?
|
20
24
|
UI.error("No swift files found :(")
|
21
25
|
exit 1
|
22
26
|
end
|
23
27
|
|
24
|
-
number_of_files
|
25
|
-
number_of_lines
|
26
|
-
largest_files
|
27
|
-
number_of_lines_largest_file = `echo '#{swift_files}' | xargs wc -l | sort -n | tail -2 | head -1 | awk '{print $1}'`
|
28
|
+
number_of_files = `echo '#{swift_files}' | wc -l | awk '{print $1}'`
|
29
|
+
number_of_lines = `echo '#{swift_files}' | tr '\\n' '\\0' | xargs -0 wc -l | tail -1 | awk '{print $1}'`
|
30
|
+
largest_files = `echo '#{swift_files}' | tr '\\n' '\\0' | xargs -0 wc -l | sort -n | tail -'#{number_of_largest_files.to_s}' | head -'#{(number_of_largest_files-1).to_s}'`
|
31
|
+
number_of_lines_largest_file = `echo '#{swift_files}' | tr '\\n' '\\0' | xargs -0 wc -l | sort -n | tail -2 | head -1 | awk '{print $1}'`
|
28
32
|
|
29
33
|
ascii_message = ""
|
30
34
|
if show_ascii == true then
|
@@ -88,7 +92,7 @@ module Fastlane
|
|
88
92
|
env_name: "FILES_EXCLUDE_REGEX",
|
89
93
|
description: "Regex string used with grep to exclude files from the list of all swift files",
|
90
94
|
optional: true,
|
91
|
-
default_value: "(/Tests|/Pods|/
|
95
|
+
default_value: "(/Tests|/Pods|/Carthage)",
|
92
96
|
type: String)
|
93
97
|
]
|
94
98
|
end
|