Skip to content

Commit

Permalink
feat: fail when directory doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldtse committed Jun 12, 2024
1 parent ff5b02a commit 422c95d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/poepod/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ class Cli < Thor
def concat(directory, output_file = nil)
dir_path = Pathname.new(directory)

# Check if the directory exists
unless dir_path.directory?
puts "Error: Directory '#{directory}' does not exist."
exit(1)
end

dir_path = dir_path.expand_path unless dir_path.absolute?

output_file ||= "#{dir_path.basename}.txt"
Expand Down

0 comments on commit 422c95d

Please sign in to comment.