Does not raise on missing directories.

master
Luka Vandervelden 2019-10-19 18:40:47 +02:00
parent 794ffe16fa
commit 365e780055
2 changed files with 6 additions and 0 deletions

View File

@ -38,6 +38,8 @@ class Environment
class_getter all = [@@root] of Environment
def self.load(path)
return unless Dir.exists? path
Dir.each_child path do |child|
unless child.match /\.spec$/
next

View File

@ -1,5 +1,6 @@
require "yaml"
require "colorize"
require "file_utils"
require "./service_definition.cr"
require "./environment.cr"
@ -296,6 +297,8 @@ class Service
class_getter all = [] of Service
def self.load(path)
return unless Dir.exists? path
Dir.each_child path do |child|
unless child.match /\.spec$/
next
@ -312,6 +315,7 @@ class Service
end
def write(path)
FileUtils.mkdir_p "#{path}"
File.write "#{path}/#{name}.#{@environment.name}.spec", to_spec
end