Skip to content

Commit

Permalink
Update logging for debugMode flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralph Schnalzenberger committed Jun 3, 2024
1 parent c48d149 commit affed83
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/fastlane/plugin/dynatrace/actions/dynatrace_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def self.run(params)
command << "#{dtxDssClientPath}"
command << "-#{params[:action]}" #"-upload"
command << "appid=\"#{params[:appId]}\""
command << "apitoken=\"#{params[:apitoken]}\""
command << "os=#{params[:os]}"
command << "bundleId=\"#{bundleId}\""
command << "versionStr=\"#{params[:versionStr]}\""
Expand All @@ -98,12 +97,17 @@ def self.run(params)
command << "forced=1" # if the file already exists
command << "tempdir=\"#{params[:tempdir]}\"" if params[:tempdir]

print_command = command

command << "apitoken=\"#{params[:apitoken]}\""
print_command << "apitoken=\"#{params[:apitoken]}\"" if params[:debugMode] == true

# Create the full shell command to trigger the DTXDssClient
shell_command = command.join(' ')

UI.message "#{shell_command}"
UI.message "#{print_command}"

sh("#{shell_command}", error_callback: ->(result) {
Fastlane::Actions.sh("#{shell_command}", log: params[:debugMode] == true, error_callback: ->(result) {
# ShAction doesn't return any reference to the return value -> parse it from the output
result_groups = result.match /(?:ERROR: Execution failed, rc=)(-?\d*)(?:\sreason=)(.*)/
if result_groups and result_groups.length() >= 2
Expand Down

0 comments on commit affed83

Please sign in to comment.