Does not raise on missing directories.
parent
794ffe16fa
commit
365e780055
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue