mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 10:30:17 +00:00
fix(main): repair contextual replacement for entries
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -117,7 +117,7 @@ fn main() -> Result<()> {
|
||||
// Associate the main context with the static entry.
|
||||
entries.push(BootableEntry::new(
|
||||
name,
|
||||
context.stamp(&entry.title),
|
||||
entry.title.clone(),
|
||||
context.clone(),
|
||||
entry,
|
||||
));
|
||||
@@ -139,7 +139,7 @@ fn main() -> Result<()> {
|
||||
}
|
||||
|
||||
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
|
||||
// sprout context to use with the entry itself.
|
||||
context.insert(&entry.declaration().values);
|
||||
@@ -154,7 +154,7 @@ fn main() -> Result<()> {
|
||||
// For now, we just print all of the entries.
|
||||
info!("entries:");
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -177,8 +177,8 @@ fn main() -> Result<()> {
|
||||
|
||||
// Execute all the actions for the selected entry.
|
||||
for action in &entry.declaration().actions {
|
||||
let action = context.stamp(action);
|
||||
actions::execute(context.clone(), &action)
|
||||
let action = entry.context().stamp(action);
|
||||
actions::execute(entry.context().clone(), &action)
|
||||
.context(format!("unable to execute action '{}'", action))?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user