Last active
January 15, 2018 12:07
-
-
Save kawakami-o3/2b8de3f802cad894c737f9cae7260195 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/env ruby | |
| require 'optparse' | |
| if not File.exist? ".vagrant" | |
| puts "not vagrant directory" | |
| return -1 | |
| end | |
| if not File.exist? ".vagrant_ssh_config" | |
| system "vagrant ssh-config > .vagrant_ssh_config" | |
| end | |
| OPTS = {} | |
| opt = OptionParser.new | |
| opt.on('-c VAL') do |v| | |
| OPTS[:c] = v | |
| end | |
| opt.parse(ARGV) | |
| command = "ssh -F .vagrant_ssh_config default" | |
| if OPTS.include?(:c) | |
| command += " '#{OPTS[:c]}'" | |
| end | |
| #puts command | |
| res = system command | |
| unless res | |
| puts "DO!!!: vagrant up" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment