fix: 🩹 properly return artefact when requiring/including
This commit is contained in:
parent
4ef870c195
commit
120c420f30
1 changed files with 8 additions and 5 deletions
|
@ -137,14 +137,18 @@ module Comfpile
|
||||||
@parent_artefact = require_artefact(stage, target)
|
@parent_artefact = require_artefact(stage, target)
|
||||||
end
|
end
|
||||||
|
|
||||||
def include_artefact(stage, target)
|
def include_artefact(stage, target, **opts)
|
||||||
artefact = require_artefact(stage, target)
|
artefact = require_artefact(stage, target, **opts)
|
||||||
@included_artefacts << artefact
|
@included_artefacts << artefact
|
||||||
|
|
||||||
|
artefact
|
||||||
end
|
end
|
||||||
|
|
||||||
def require_artefact(stage, target)
|
def require_artefact(stage, target, **opts)
|
||||||
artefact = reference_artefact(stage, target, required: true)
|
artefact = reference_artefact(stage, target, required: true, **opts)
|
||||||
@required_artefacts << artefact
|
@required_artefacts << artefact
|
||||||
|
|
||||||
|
artefact
|
||||||
end
|
end
|
||||||
|
|
||||||
def reference_artefact(stage, target, required: false)
|
def reference_artefact(stage, target, required: false)
|
||||||
|
@ -164,7 +168,6 @@ module Comfpile
|
||||||
artefact
|
artefact
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
|
||||||
# Find or create a new artefact
|
# Find or create a new artefact
|
||||||
#
|
#
|
||||||
# @param [Symbol] stage The type of item to create.
|
# @param [Symbol] stage The type of item to create.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue