lib/awestruct/cli/invoker.rb in awestruct-0.4.2.x7 vs lib/awestruct/cli/invoker.rb in awestruct-0.4.2.x8

- old
+ new

@@ -52,17 +52,25 @@ profiles_data = site_yaml['profiles'] || {} @profile = if profiles_data.nil? nil else if options.profile - profiles_data[options.profile] + profiles_data[options.profile] || {} else # if no profile given, pick the first with deploy config options.profile, profile_data = profiles_data.select { |k,v| v && v['deploy'] }.first + profile_data end end end end + + unless @profile + $stderr.puts "Unable to locate profile: #{options.profile}" if options.profile + options.profile = 'NONE' + @profile = {} + end + $stderr.puts "Using profile: #{options.profile}" end def setup_config() @config = Awestruct::Config.new( Dir.pwd ) @config.track_dependencies = true if ( options.auto )