lib/cicd/builder/mixlib/repo/artifactory.rb in cicd-builder-0.9.41 vs lib/cicd/builder/mixlib/repo/artifactory.rb in cicd-builder-0.9.42
- old
+ new
@@ -102,9 +102,10 @@
def get_artifact_file_name_ext(data)
file_name = File.basename(data[:file])
if file_name =~ %r'^#{data[:name]}'
file_name.gsub!(%r'^#{data[:name]}\.*', '')
end
+ file_name.gsub!(%r'\.\.+','.')
file_name.gsub!(%r'\.*-*#{data[:version]}', '')
file_name.gsub!(%r'\.*-*#{data[:build]}-*', '')
file_ext = file_name.dup
file_ext.gsub!(%r'^.*?\.*(tar\.gz|tgz|tar\.bzip2|bzip2|tar\.bz2|bz2|zip|jar|war|groovy)$', '\1')
unless file_ext.empty?
\ No newline at end of file