From d5fca611ce6b60d8ba15c576e91a885ccbb12da6 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Wed, 10 Jul 2024 19:35:06 -0700 Subject: [PATCH] Allow program names with ot without the .aleo suffix --- leo/cli/commands/execute.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/leo/cli/commands/execute.rs b/leo/cli/commands/execute.rs index cee8dc6e84..0f9be2bb4e 100644 --- a/leo/cli/commands/execute.rs +++ b/leo/cli/commands/execute.rs @@ -172,8 +172,13 @@ fn handle_execute( // Initialize the VM. let vm = VM::from(store)?; + // Remove the `.aleo` extension from the program name, if it exists. + let program_name = match program_name.strip_suffix(".aleo") { + Some(name) => name.to_string(), + None => program_name, + }; // Load the main program, and all of its imports. - let program_id = &ProgramID::::from_str(&format!("{}.aleo", program_name))?; + let program_id = &ProgramID::::from_str(&format!("{program_name}.aleo"))?; load_program_from_network(context.clone(), &mut vm.process().write(), program_id, network, endpoint)?; let fee_record = if let Some(record) = command.fee_options.record {