Skip to content

Commit

Permalink
fix: linting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkProminic committed Jan 9, 2024
1 parent 7735b66 commit ce961e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Metrics/ClassLength:
Enabled: true
Exclude:
- lib/vagrant-zones/driver*
- lib/vagrant-zones/action/package*

Naming/MethodName:
EnforcedStyle: snake_case
Expand Down
11 changes: 10 additions & 1 deletion lib/vagrant-zones/action/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ def call(env)
kernel = @machine.provider_config.kernel
vcc = @machine.provider_config.vagrant_cloud_creator
boxshortname = @machine.provider_config.boxshortname
vagrant_cloud_creator = @machine.provider_config.vagrant_cloud_creator
files = {}
raise "#{boxname}: Already exists" if File.exist?(boxname)

## Create Snapshot
Dir.mkdir("#{Dir.pwd}/_tmp_package")
datasetpath = "#{@machine.provider_config.boot['array']}/#{@machine.provider_config.boot['dataset']}/#{name}"
t = Time.new
datetime = %(#{t.year}-#{t.month}-#{t.day}-#{t.hour}:#{t.min}:#{t.sec})
Expand All @@ -63,7 +65,7 @@ def call(env)
end

files.each do |from, dest|
include_directory = Pathname.new("#{Dir.pwd}/_tmp_package")
include_directory = Pathname.new("#{Dir.pwd}/_tmp_package/")
to = include_directory.join(dest)
FileUtils.mkdir_p(to.parent)
if File.directory?(from)
Expand All @@ -86,6 +88,13 @@ def call(env)

files[env['package.vagrantfile']] = '_Vagrantfile' if env['package.vagrantfile']

info_content_hash = {
'boxname' => "#{boxshortname}",
'Author' => "#{vagrant_cloud_creator}",
'Vagrant-Zones' => "This box was built with Vagrant-Zones: https://github.com/STARTcloud/vagrant-zones"
}
File.write("#{Dir.pwd}/_tmp_package/info.json", info_content_hash.to_json)

metadata_content_hash = {
'provider' => 'zone',
'architecture' => 'amd64',
Expand Down

0 comments on commit ce961e3

Please sign in to comment.