vagrant-commit 0.6.3 → 0.6.4

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: e5b0d5a0087bdcf20eb204577dd50c03b6bcc63949e3902a57108b6a18e6306c
4
- data.tar.gz: 8900b2954e078beb3c398e1444cc5541792247f54f5181c86f42854e49993f4d
3
+ metadata.gz: 67f17a6c13e9b073d04c374fce119854900b35cc67ac51428574945cab4bdae5
4
+ data.tar.gz: f77225cdb10d2c76f499f5c5934610dba7925e768bc49498d5e28f495abdd90d
5
5
  SHA512:
6
- metadata.gz: 8abe2bc22f68ce65e424aaf725ca6d7f52586e166219e9b0393ba556f2f1ade0dcecbef29cbf6a0525074d234b2eef518665dccd7063e8b93e4ec7843a5f7603
7
- data.tar.gz: a264b2923444f40d1dc4775aac54ff9421b380794de786a0e69936a276d5e69414aab6e787624f14de60809d849b7e4c43c38a68da19a67081b62b5bb3626eef
6
+ metadata.gz: bff04b0591a5808e6682c1baa6b60a47bd68c6eedce96506e45f6f494be1a1a6f9cd25d4d9eaabad229f2e7f2bcd2c02cdcbe4fb77a176c8d3be669052dd6079
7
+ data.tar.gz: e31dd7568dd7146c415f7df36a34c8a2450687fca5b1bfd33defcb2b0835f40c2cefbfc98502b177e9821b1894b343dd8551f247a8feb54d50d5b98cb6ee5309
data/README.md CHANGED
@@ -1,12 +1,13 @@
1
1
  Current way to install (execute in current directory):
2
2
 
3
3
  ```
4
- /usr/bin/ruby /usr/bin/gem build ./vagrant-commit.gemspec
5
- vagrant plugin install ./vagrant-commit-0.5.6.gem
4
+ vagrant plugin install vagrant-commit
6
5
  ```
7
6
 
8
7
  Usage:
9
8
 
10
9
  ```
11
- vagrant commit [hostname]
10
+ vagrant copybox generic/ubuntu1904 mybox
11
+ vagrant init mybox
12
+ vagrant commit
12
13
  ```
@@ -128,18 +128,25 @@ module Vagrant
128
128
  end
129
129
  collection = Vagrant::BoxCollection.new(@env.boxes_path)
130
130
  box = collection.find(src_boxname, :libvirt, "> 0")
131
+ if !box
132
+ @env.ui.error("Box #{src_boxname} not found")
133
+ return 1
134
+ end
131
135
  provider = box.metadata["provider"]
132
136
 
133
137
  # create necessary files in the boxes path
134
138
  root_dir = @env.boxes_path
135
139
  version = "0"
136
140
  new_box_dir = root_dir.join(target_boxname).join(version).join(provider.to_s)
137
- existing_box_found = false
138
141
  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)
142
+ ans = @env.ui.ask("Box #{target_boxname} exists. What to do? [use/remove/exit] ")
143
+ if ans.strip.downcase == "use"
144
+ return 0
145
+ elsif ans.strip.downcase == "remove"
146
+ FileUtils.rm_rf(new_box_dir)
147
+ @env.ui.info("Box removed. You probably want to run vagrant fulldestroy.")
148
+ end
149
+ return 1
143
150
  end
144
151
  new_box_dir.mkpath
145
152
  new_box_dir.join("metadata.json").open("w") do |f|
@@ -151,9 +158,6 @@ module Vagrant
151
158
  src_path = box.directory.join("box.img")
152
159
  target_path = new_box_dir.join("box.img")
153
160
  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
157
161
  end
158
162
  end
159
163
  end
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Commit
3
- VERSION = "0.6.3"
3
+ VERSION = "0.6.4"
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.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitalii Abetkin