Compare commits
1 commit
6100722c1e
...
e06c3030f4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e06c3030f4 |
1 changed files with 17 additions and 2 deletions
|
|
@ -155,7 +155,8 @@ load_formula_or_profile() {
|
|||
if [ -n "$AGENT_IDENTITY" ] && ensure_profile_repo "$AGENT_IDENTITY"; then
|
||||
if [ -f "$PROFILE_FORMULA_PATH" ]; then
|
||||
log "formula source: .profile (${PROFILE_FORMULA_PATH})"
|
||||
FORMULA_CONTENT=$(cat "$PROFILE_FORMULA_PATH")
|
||||
# shellcheck disable=SC2034
|
||||
FORMULA_CONTENT="$(cat "$PROFILE_FORMULA_PATH")"
|
||||
FORMULA_SOURCE=".profile"
|
||||
return 0
|
||||
else
|
||||
|
|
@ -167,7 +168,8 @@ load_formula_or_profile() {
|
|||
if [ -n "$fallback_formula" ]; then
|
||||
if [ -f "$fallback_formula" ]; then
|
||||
log "formula source: formulas/ (fallback) — ${fallback_formula}"
|
||||
FORMULA_CONTENT=$(cat "$fallback_formula")
|
||||
# shellcheck disable=SC2034
|
||||
FORMULA_CONTENT="$(cat "$fallback_formula")"
|
||||
FORMULA_SOURCE="formulas/"
|
||||
return 0
|
||||
else
|
||||
|
|
@ -176,6 +178,19 @@ load_formula_or_profile() {
|
|||
fi
|
||||
fi
|
||||
|
||||
# No fallback specified but role provided — construct fallback path
|
||||
if [ -n "$role" ]; then
|
||||
fallback_formula="${FACTORY_ROOT}/formulas/${role}.toml"
|
||||
if [ -f "$fallback_formula" ]; then
|
||||
log "formula source: formulas/ (fallback) — ${fallback_formula}"
|
||||
# shellcheck disable=SC2034
|
||||
FORMULA_CONTENT="$(cat "$fallback_formula")"
|
||||
# shellcheck disable=SC2034
|
||||
FORMULA_SOURCE="formulas/"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# No fallback specified
|
||||
log "ERROR: formula not found in .profile and no fallback specified"
|
||||
return 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue