fix(main): repair contextual replacement for entries

This commit is contained in:
2025-10-24 17:16:42 -07:00
parent e10e98d669
commit 30600f0c81

View File

@@ -117,7 +117,7 @@ fn main() -> Result<()> {
// Associate the main context with the static entry. // Associate the main context with the static entry.
entries.push(BootableEntry::new( entries.push(BootableEntry::new(
name, name,
context.stamp(&entry.title), entry.title.clone(),
context.clone(), context.clone(),
entry, entry,
)); ));
@@ -139,7 +139,7 @@ fn main() -> Result<()> {
} }
for entry in &mut entries { for entry in &mut entries {
let mut context = context.fork(); let mut context = entry.context().fork();
// Insert the values from the entry configuration into the // Insert the values from the entry configuration into the
// sprout context to use with the entry itself. // sprout context to use with the entry itself.
context.insert(&entry.declaration().values); context.insert(&entry.declaration().values);
@@ -154,7 +154,7 @@ fn main() -> Result<()> {
// For now, we just print all of the entries. // For now, we just print all of the entries.
info!("entries:"); info!("entries:");
for (index, entry) in entries.iter().enumerate() { for (index, entry) in entries.iter().enumerate() {
let title = context.stamp(&entry.declaration().title); let title = entry.context().stamp(&entry.declaration().title);
info!(" entry {} [{}]: {}", index, entry.name(), title); info!(" entry {} [{}]: {}", index, entry.name(), title);
} }
@@ -177,8 +177,8 @@ fn main() -> Result<()> {
// Execute all the actions for the selected entry. // Execute all the actions for the selected entry.
for action in &entry.declaration().actions { for action in &entry.declaration().actions {
let action = context.stamp(action); let action = entry.context().stamp(action);
actions::execute(context.clone(), &action) actions::execute(entry.context().clone(), &action)
.context(format!("unable to execute action '{}'", action))?; .context(format!("unable to execute action '{}'", action))?;
} }