16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/zendesk_apps_support/validations/manifest.rb', line 16
def call(package, apply_password_parameter_check: false)
unless package.has_file?('manifest.json')
nested_manifest = package.files.find { |file| file =~ %r{\A[^/]+?/manifest\.json\Z} }
if nested_manifest
return [ValidationError.new(:nested_manifest, found_path: nested_manifest.relative_path)]
end
return [ValidationError.new(:missing_manifest)]
end
collate_manifest_errors(package, apply_password_parameter_check)
rescue JSON::ParserError => e
return [ValidationError.new(:manifest_not_json, errors: e)]
rescue ZendeskAppsSupport::Manifest::OverrideError => e
return [ValidationError.new(:duplicate_manifest_keys, errors: e.message)]
end
|