Added 'add_fuel' command line option (#3792)
* Added 'add_fuel' command line option * Added default value to 'add_fuel' config option * Added 'add_fuel' to run command Store instantiation * Added comment * Added warning for add-fuel without consume-fuel * Formatting * Changed out --add-fuel and --consume-fuel to --fuel * Formatting * Update src/lib.rs * Update src/commands/run.rs Co-authored-by: Nick Fitzgerald <fitzgen@gmail.com>
This commit is contained in:
@@ -164,6 +164,12 @@ impl RunCommand {
|
||||
let engine = Engine::new(&config)?;
|
||||
let mut store = Store::new(&engine, Host::default());
|
||||
|
||||
// If fuel has been configured, we want to add the configured
|
||||
// fuel amount to this store.
|
||||
if let Some(fuel) = self.common.fuel {
|
||||
store.add_fuel(fuel)?;
|
||||
}
|
||||
|
||||
let preopen_sockets = self.compute_preopen_sockets()?;
|
||||
|
||||
// Make wasi available by default.
|
||||
|
||||
Reference in New Issue
Block a user