vagrant-commit 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3eb036a6543f9c1e507d42fa617c38e800dc39f540ab1d4b67bfccfeadd3678
4
- data.tar.gz: '08a2191cb407e4c6b2e5efe7c6f0152929c4c29b6b4d2d43d158b311267a39dd'
3
+ metadata.gz: e5b0d5a0087bdcf20eb204577dd50c03b6bcc63949e3902a57108b6a18e6306c
4
+ data.tar.gz: 8900b2954e078beb3c398e1444cc5541792247f54f5181c86f42854e49993f4d
5
5
  SHA512:
6
- metadata.gz: 21ca5f113431fee0948d954b47f8fe1b8fe5e8e2a101d5c125252ad8ac40e693f394d7c3d4a1743a552f41e36ac29cb2bfd2d4d7dd64d468f78b79b716ac1612
7
- data.tar.gz: fad492002deb493cd051be5e3992a66def10c79a7e4d766121944b52e0aa74c0d3c2205c2996ab42a26b3a75a911864fb13bc92cb743d3b147ac766e8bb7fe25
6
+ metadata.gz: 8abe2bc22f68ce65e424aaf725ca6d7f52586e166219e9b0393ba556f2f1ade0dcecbef29cbf6a0525074d234b2eef518665dccd7063e8b93e4ec7843a5f7603
7
+ data.tar.gz: a264b2923444f40d1dc4775aac54ff9421b380794de786a0e69936a276d5e69414aab6e787624f14de60809d849b7e4c43c38a68da19a67081b62b5bb3626eef
@@ -134,9 +134,12 @@ module Vagrant
134
134
  root_dir = @env.boxes_path
135
135
  version = "0"
136
136
  new_box_dir = root_dir.join(target_boxname).join(version).join(provider.to_s)
137
- cont = @env.ui.ask("Box #{target_boxname} exists. Recreate? [y/n]")
138
- if cont.strip.downcase != "y"
139
- return 1
137
+ existing_box_found = false
138
+ if File.exist?(new_box_dir)
139
+ existing_box_found = true
140
+ ans = @env.ui.ask("Box #{target_boxname} exists. Recreate? [y/n] ")
141
+ return 1 if ans.strip.downcase != "y"
142
+ FileUtils.rm_rf(new_box_dir)
140
143
  end
141
144
  new_box_dir.mkpath
142
145
  new_box_dir.join("metadata.json").open("w") do |f|
@@ -148,6 +151,9 @@ module Vagrant
148
151
  src_path = box.directory.join("box.img")
149
152
  target_path = new_box_dir.join("box.img")
150
153
  FileUtils.cp(src_path, target_path)
154
+ if existing_box_found
155
+ @env.ui.info("Box recreated. You probably want to run vagrant fulldestroy to use the new box.")
156
+ end
151
157
  end
152
158
  end
153
159
  end
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Commit
3
- VERSION = "0.6.2"
3
+ VERSION = "0.6.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-commit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitalii Abetkin