Created
July 31, 2017 03:43
-
-
Save nomeaning777/c2270d4603a742d90c1760582f7d01c4 to your computer and use it in GitHub Desktop.
古いvagrant boxを削除する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
data = `vagrant box list`.gsub(/\(|\)|,/,'').lines.sort.map(&:split) | |
u = [] | |
data.reverse_each do |name, provider, version| | |
if u.include?([name, provider]) | |
system 'vagrant', 'box', 'remove', '--provider', provider, '--box-version', version, name | |
else | |
u << [name, provider] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment