Skip to content

Commit

Permalink
Add profile version to archive
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Briggs committed Dec 8, 2016
1 parent db96fe0 commit 354c19b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/inspec/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,12 @@ def archive_name(opts)
name = params[:name] ||
fail('Cannot create an archive without a profile name! Please '\
'specify the name in metadata or use --output to create the archive.')
version = params[:version] ||
fail('Cannot create an archive with a profile version! Please '\
'specify the version in metadat or use --output to create the archive.')
ext = opts[:zip] ? 'zip' : 'tar.gz'
slug = name.downcase.strip.tr(' ', '-').gsub(/[^\w-]/, '_')
Pathname.new(Dir.pwd).join("#{slug}.#{ext}")
Pathname.new(Dir.pwd).join("#{slug}-#{version}.#{ext}")
end

def load_params
Expand Down

0 comments on commit 354c19b

Please sign in to comment.