diff --git a/src/main.cr b/src/main.cr index 2adde48..1711702 100644 --- a/src/main.cr +++ b/src/main.cr @@ -76,6 +76,23 @@ end begin latest_build_dir = "" + + dependencies = [] of String + recipes.each do |recipe| + recipe.build_dependencies.each do |dep| + dependencies << dep unless dependencies.any? &.==(dep) + end + end + + if dependencies.size > 0 + # FIXME: We’ll probably want to have backends other than apk at some point. + r = context.sh "apk add #{ENV["APK_FLAGS"]? || "-i"} #{dependencies.join " "}" + if r.exit_status != 0 + STDERR.puts "!! Running apk failed!" + exit 8 + end + end + recipes.each do |recipe| latest_build_dir = recipe.building_directory