10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/wdi_tf/project.rb', line 10
def load_source_files
files = {}
conflict = false
if @project.has_key?('source')
verbose("Load the source files from the Project file.")
@project['source'].each do |file|
if Dir.exists?(file)
Dir["#{ file }/*.tf"].each do |f|
@project['source'].push(f)
end
else
base = File.basename(file)
if files.has_key?(base)
verbose(" conflict #{ file } (local file with same name)")
conflict = true
else
if File.extname(file) == ".tf"
verbose(" using #{ file }")
files[base] = file
else
verbose(" skipping #{ file } (not a *.tf file)")
end
end
end
end
end
if conflict
error(msg: "One or more files are conflicting with files already in the workspace with the same name.", code: 1)
end
return files
end
|