Permalink
Browse files

Let users provide their own config.

  • Loading branch information...
1 parent ffd57fd commit cb2defdcdd8c6f8e38dba08502242193b176d99e @darrenboyd committed Apr 6, 2012
Showing with 9 additions and 8 deletions.
  1. +9 −8 lib/cynq/command.rb
View
@@ -2,6 +2,7 @@
require 'colorize'
require 'cynq/local'
require 'cynq/remote'
+require 'yaml'
module Cynq
class Command < Thor
@@ -41,14 +42,14 @@ def deploy(remote)
no_tasks do
def load_config(remote)
- @config = {
- 'local_root' => 'build',
- 'remotes' => {
- 'production' => {
- 'directory' => 'www.realgravity.com'
- }
- }
- }
+ conf_file = File.expand_path('cynq.yml')
+
+ unless File.exist?(conf_file)
+ $stderr.puts "Missing configuration file at #{conf_file}"
+ raise "Configuration not found"
+ end
+
+ @config = YAML::load_file(conf_file)
@local_root = File.expand_path(@config['local_root'])
unless Dir.exist?(@local_root)

0 comments on commit cb2defd

Please sign in to comment.