@@ -27,7 +27,7 @@ class Snapshots < EmergeCLI::Commands::GlobalOptions
2727 option :pr_number , type : :string , required : false , desc : 'PR number'
2828 option :concurrency , type : :integer , default : 5 , desc : 'Number of concurrency for parallel uploads'
2929
30- option :client_library , type : :string , required : false , values : %w[ swift-snapshot-testing paparazzi ] ,
30+ option :client_library , type : :string , required : false , values : %w[ swift-snapshot-testing paparazzi roborazzi ] ,
3131 desc : 'Client library used for snapshots'
3232 option :project_root , type : :string , required : false , desc : 'Path to the project root'
3333
@@ -88,7 +88,7 @@ def call(image_paths:, **options)
8888
8989 def validate_options ( image_paths )
9090 if @options [ :client_library ] && !@options [ :project_root ]
91- raise 'Project path is required when using a client library'
91+ raise 'Project root is required when using a client library'
9292 end
9393 if @options [ :project_root ] && !@options [ :client_library ]
9494 raise 'Client library is required when using a project path'
@@ -98,11 +98,17 @@ def validate_options(image_paths)
9898 end
9999
100100 def create_client ( image_paths )
101- case @options [ :client_library ]
102- when 'swift-snapshot-testing'
103- ClientLibraries ::SwiftSnapshotTesting . new ( @options [ :project_root ] )
104- when 'paparazzi'
105- ClientLibraries ::Paparazzi . new ( @options [ :project_root ] )
101+ if @options [ :client_library ]
102+ case @options [ :client_library ]
103+ when 'swift-snapshot-testing'
104+ ClientLibraries ::SwiftSnapshotTesting . new ( @options [ :project_root ] )
105+ when 'paparazzi'
106+ ClientLibraries ::Paparazzi . new ( @options [ :project_root ] )
107+ when 'roborazzi'
108+ ClientLibraries ::Roborazzi . new ( @options [ :project_root ] )
109+ else
110+ raise "Unsupported client library: #{ @options [ :client_library ] } "
111+ end
106112 else
107113 ClientLibraries ::Default . new ( image_paths )
108114 end
0 commit comments