bin/soloist in soloist-0.0.1 vs bin/soloist in soloist-0.0.2
- old
+ new
@@ -10,37 +10,38 @@
file << contents
file.flush
file
end
-class Array
- def to_array_string
- "[\"#{self.join("\", \"")}\"]"
- end
-end
-
def walk_up_and_find_file(filenames)
pwd = FileUtils.pwd
file = nil
path_to_file = ""
while !file && FileUtils.pwd != '/'
file = filenames.detect { |f| Dir.glob("*").include?(f) }
FileUtils.cd("..")
path_to_file << "../" unless file
end
FileUtils.cd(pwd)
- File.read(path_to_file + file) if file
+ file_contents = File.read(path_to_file + file) if file
+ [file_contents, path_to_file]
end
log_level = ENV['LOG_LEVEL'] || "info"
-soloistrc = YAML.load(walk_up_and_find_file(["soloistrc"]))
+solistrc_contents, soloistrc_path = walk_up_and_find_file(["soloistrc"])
+soloistrc = YAML.load(solistrc_contents)
json_contents = {
:recipes => soloistrc["Recipes"]
}
-solo_rb_contents = "cookbook_path #{soloistrc["Cookbook_Paths"].to_array_string}"
+cookbook_paths = soloistrc["Cookbook_Paths"].map do |v|
+ (v =~ /\//) == 0 ? v : "#{FileUtils.pwd}/#{soloistrc_path}/#{v}"
+end
+puts FileUtils.pwd
+puts cookbook_paths.inspect
+solo_rb_contents = "cookbook_path #{cookbook_paths.inspect}"
# if ARGV.length >= 1
# json_config = JSON.parse(File.read(json_file))
# json_config["recipes"] = ARGV
# json_file = "/tmp/#{File.basename(json_file)}"
\ No newline at end of file