Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/svg_conform/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def method_missing(method_name, *_args)
puts Paint["Unknown command: #{method_name}", :red]
puts
help
exit 1
abort
end
end
end
14 changes: 7 additions & 7 deletions lib/svg_conform/commands/check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def execute

if files_to_process.empty?
puts Paint["Error: No SVG files found", :red]
exit 1
abort
end

# Single file mode vs batch mode
Expand All @@ -39,19 +39,19 @@ def determine_files
dir = @options[:directory]
unless Dir.exist?(dir)
puts Paint["Error: Directory '#{dir}' not found", :red]
exit 1
abort
end
Dir.glob(File.join(dir, "**/*.svg")).sort
elsif @files.empty?
puts Paint["Error: No files or directory specified", :red]
exit 1
abort
[]
else
# File mode: validate each file exists
@files.each do |file|
unless File.exist?(file)
puts Paint["Error: File '#{file}' not found", :red]
exit 1
abort
end
end
@files
Expand Down Expand Up @@ -91,7 +91,7 @@ def process_single_file(file)
exit(report.valid? ? 0 : 1)
rescue StandardError => e
puts Paint["Error: #{e.message}", :red]
exit 1
abort
end
end

Expand Down Expand Up @@ -277,13 +277,13 @@ def validate_output_options(files)
if files.length > 1 && !@options[:output_dir]
puts Paint["Error: --output-dir required for multiple files with --fix",
:red]
exit 1
abort
end

# In-place requires force
if @options[:in_place] && !@options[:force]
puts Paint["Error: --in-place requires --force flag for safety", :red]
exit 1
abort
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/svg_conform/commands/profiles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def execute
end
rescue StandardError => e
puts Paint["Error: #{e.message}", :red]
exit 1
abort
end

private
Expand Down
6 changes: 3 additions & 3 deletions lib/svg_conform/commands/svgcheck_compare.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def execute

unless File.exist?(validation_file)
puts Paint["Error: File '#{validation_file}' not found", :red]
exit 1
abort
end

begin
Expand All @@ -30,7 +30,7 @@ def execute
puts Paint["Expected: #{svgcheck_report_path}",
:dim]
end
exit 1
abort
end

# Load svgcheck report using the new external checker parser
Expand All @@ -55,7 +55,7 @@ def execute
File.basename(@file))
rescue StandardError => e
puts Paint["Error: #{e.message}", :red]
exit 1
abort
end
end

Expand Down
Loading