Skip to content

Commit

Permalink
Fix SSH command result comparison to handle nil values and improve de…
Browse files Browse the repository at this point in the history
…bug output
  • Loading branch information
vitobotta committed Jan 26, 2025
1 parent 5cdcbb7 commit b559609
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/util/ssh.cr
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ class Util::SSH
end
end

result ||= ""

if ENV.fetch("DEBUG", "false") == "true"
puts "SSH command result: ===#{result}==="
puts "SSH command expected: ===#{expected_result}==="
end

break result if result.strip.gsub(/[\r\n]/, "") == expected_result
break result if result.not_nil!.strip.gsub(/[\r\n]/, "") == expected_result
end

result
Expand Down

0 comments on commit b559609

Please sign in to comment.