Baker: Fix directory creation
What
Closes #8046 (closed).
Why
As described in the issue, running a baker with a specific base directory meant the creation of the default directory ~/.tezos-client (which contained nothing, but it was created for no reason).
How
The reason why this happened was because when we parsed the arguments from the CLI, we forgot to remove the first argument (which is ./octez-baker). This is done properly in the src/lib_client_base_unix/client_main_run.ml main function, where the first argument is omitted:
match Array.to_list Sys.argv with
| _ :: args -> move_autocomplete_token_upfront [] args
| [] -> ([], None)
So, since we follow the behaviour in the agnostic baker as well, we needed to remove it as well. Otherwise, the parsing of the arguments was not done properly (by parse_config_args in src/lib_client_base_unix/client_config.ml), therefore a new directory would be created.
Manually testing the MR
Check that the ~/.tezos-client directory is no longer created now that you run the baker.
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR