feat: ✨ begin the repo a bit late but better than never
This commit is contained in:
commit
607159334b
22 changed files with 898 additions and 0 deletions
25
lib/comfpile/engines/filesource_engine.rb
Normal file
25
lib/comfpile/engines/filesource_engine.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
|
||||
module Comfpile
|
||||
class FilesourceEngine < ArtefactEngine
|
||||
def initialize(core, **options)
|
||||
super(core, **options)
|
||||
|
||||
@root_path = options[:root_path]
|
||||
end
|
||||
|
||||
def craft(stage, target)
|
||||
return nil unless stage == :sourcefile
|
||||
|
||||
full_path = File.join(@root_path, target)
|
||||
|
||||
return nil unless File.exists? full_path
|
||||
|
||||
a = Artefact.new(@core, self, stage, target);
|
||||
a[:file] = full_path
|
||||
a[:filepath] = full_path
|
||||
|
||||
a
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue