bin/sauce in sauce-0.9.0 vs bin/sauce in sauce-0.10.0
- old
+ new
@@ -1,10 +1,11 @@
#!/usr/bin/env ruby
require 'rubygems'
require 'cmdparse'
require 'yaml'
+require 'fileutils'
sauce_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(sauce_dir) unless $LOAD_PATH.include?(sauce_dir)
# special case for sauce connect
@@ -28,10 +29,13 @@
puts "Usage: sauce configure USERNAME ACCESS_KEY"
exit 1
end
username = args[0]
access_key = args[1]
- out = File.new(File.join(File.dirname(File.expand_path(File.dirname(__FILE__))), "ondemand.yml"), 'w')
+ dir = File.join(File.expand_path("~"), ".sauce")
+ FileUtils.mkdir(dir) unless File.directory?(dir)
+
+ out = File.new(File.join(dir, "ondemand.yml"), 'w')
out.write(YAML.dump({"username" => username, "access_key" => access_key}))
out.close()
end
cmd.add_command(configure)