lib/fastlane/environment_printer.rb in fastlane-1.110.0 vs lib/fastlane/environment_printer.rb in fastlane-1.111.0
- old
+ new
@@ -205,19 +205,19 @@
"fastlane" => Fastlane::VERSION,
"OS" => os_version,
"Ruby" => RUBY_VERSION,
"Bundler?" => Helper.bundler?,
"Git" => `git --version`.strip.split("\n").first,
- "Installation Source" => $PROGRAM_NAME,
+ "Installation Source" => anonymized_path($PROGRAM_NAME),
"Host" => "#{product} #{version} (#{build})",
- "Ruby Lib Dir" => RbConfig::CONFIG['libdir'],
+ "Ruby Lib Dir" => anonymized_path(RbConfig::CONFIG['libdir']),
"OpenSSL Version" => OpenSSL::OPENSSL_VERSION,
"Is contained" => Helper.contained_fastlane?.to_s
}
if Helper.mac?
- table_content["Xcode Path"] = Helper.xcode_path
+ table_content["Xcode Path"] = anonymized_path(Helper.xcode_path)
table_content["Xcode Version"] = Helper.xcode_version
end
table = ["| Key | Value |"]
table += table_content.collect { |k, v| "| #{k} | #{v} |" }
@@ -266,9 +266,13 @@
else
env_output << "**No Appfile found**\n"
end
env_output << "\n\n"
env_output
+ end
+
+ def self.anonymized_path(path, home = ENV['HOME'])
+ return home ? path.gsub(%r{^#{home}(?=/(.*)|$)}, '~\2') : path
end
# Copy a given string into the clipboard
# Make sure to ask the user first, as some people don't
# use a clipboard manager, so they might lose something important