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: '080c728e50a90f2ee634cc5314706462f9c08035'
4
- data.tar.gz: 0f8b91ece89e7e50780d97c95953c57fe09546f6
3
+ metadata.gz: 733ca26cf1963a90e2b3580a3b96f8a44c256dd5
4
+ data.tar.gz: 151a4113ae59818dd422647b4a85b1313ce9293a
5
5
  SHA512:
6
- metadata.gz: c468309674d66286b657263b2622f2ba1f98b8212eabe39ce55eb194d95545826a4aaf6eb4e0064552451194893b12132f128477eb6ef60148889016eaf565a6
7
- data.tar.gz: d0e75e7b95268cb7919c93d3bb6938de7e743d402bf80a2125f56b943186a07e28d5a70836a72b88a085498c1096716f2dbc81404701f4c978fa0d5c2d7b0162
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
- swift_files = `find #{current_dir} -name \"*.swift\" | egrep -v \"#{exclude_regex}\"`
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 = `echo '#{swift_files}' | wc -l | awk '{print $1}'`
25
- number_of_lines = `echo '#{swift_files}' | xargs wc -l | tail -1 | awk '{print $1}'`
26
- largest_files = `echo '#{swift_files}' | xargs wc -l | sort -n | tail -'#{number_of_largest_files.to_s}' | head -'#{(number_of_largest_files-1).to_s}'`
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|/Frameworks|/Carthage)",
95
+ default_value: "(/Tests|/Pods|/Carthage)",
92
96
  type: String)
93
97
  ]
94
98
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module NumberOfSwiftLines
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-number_of_swift_lines
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis Charmington