nfdc: execute a batch of commands defined in a separate file
At least until we change how a large number of commands is processed by NFD, we need to accomodate case when nfdc is used to create multiple faces/routes at once. The current solution of executing nfdc multiple times faces an issue of command being rejected, as there is no state kept between individual executions of nfdc and signature may include the same timestamp (and as such, deemed invalid), e.g., when running on a powerful machine.
This feature is a simple modification to nfdc to allow multiple commands to be executed while preserving the signing state, thus creating signatures that will not be incorrectly rejected by the validator.
Updated by Junxiao Shi 4 months ago
If one of the commands contains a syntax error, should nfdc validate all the commands before trying to execute the batch?
If one of the commands is syntactically correct but has an execution failure (e.g.
strategy set with a non-existent strategy), should nfdc continue executing the next commands or terminate?
Updated by Alex Afanasyev 4 months ago
One thing I wasn't sure whether to proceed executing commands after an error or abort. Right now, the commands are aborted. Exception is the case when issue is in format of the command, which will just stop processing and will not execute commands at all.
^ this also an answer to Junxiao's question.
Updated by Davide Pesavento 4 months ago
The obvious (and safer) choice is to stop executing the list of commands as soon as one fails (and return its exit code). We can extend the format later to ignore the exit status of a command and continue through the list (e.g. prefix the command with "-" like in