Skip to content

Commit

Permalink
Fix rubycritic and skunk calls to save artifacts in the right folder
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusdeap committed Feb 12, 2025
1 parent ac8caa1 commit fcdce10
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions entrypoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
# Get arguments passed to the container
commands = ARGV

def run_rubycritic
system("rubycritic -p reports/rubycritic")
end

def run_skunk
system("skunk -o reports/skunk.txt")
end

# Default behavior: Run both tools if no args are provided
if commands.empty?
puts "No arguments provided. Running both RubyCritic and Skunk..."
system("rubycritic")
system("skunk -o skunk.txt")
run_rubycritic
exit 0
end

Expand All @@ -16,10 +23,10 @@
case command
when "rubycritic"
puts "Running RubyCritic..."
system("rubycritic")
run_rubycritic
when "skunk"
puts "Running Skunk..."
system("skunk -o skunk.txt")
run_skunk
else
puts "Invalid argument: #{command}"
puts "Usage: docker run --rm <image> [rubycritic] [skunk]"
Expand Down

0 comments on commit fcdce10

Please sign in to comment.