vagrant-commit 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/vagrant-commit/command.rb +9 -3
- data/lib/vagrant-commit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e5b0d5a0087bdcf20eb204577dd50c03b6bcc63949e3902a57108b6a18e6306c
|
|
4
|
+
data.tar.gz: 8900b2954e078beb3c398e1444cc5541792247f54f5181c86f42854e49993f4d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
138
|
-
if
|
|
139
|
-
|
|
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
|