fix: 🩹 properly return artefact when requiring/including

This commit is contained in:
David Bailey 2023-04-13 09:50:48 +02:00
parent 4ef870c195
commit 120c420f30

View file

@ -137,14 +137,18 @@ module Comfpile
@parent_artefact = require_artefact(stage, target)
end
def include_artefact(stage, target)
artefact = require_artefact(stage, target)
def include_artefact(stage, target, **opts)
artefact = require_artefact(stage, target, **opts)
@included_artefacts << artefact
artefact
end
def require_artefact(stage, target)
artefact = reference_artefact(stage, target, required: true)
def require_artefact(stage, target, **opts)
artefact = reference_artefact(stage, target, required: true, **opts)
@required_artefacts << artefact
artefact
end
def reference_artefact(stage, target, required: false)
@ -164,7 +168,6 @@ module Comfpile
artefact
end
#
# Find or create a new artefact
#
# @param [Symbol] stage The type of item to create.