dim: do not do local variable assignments in declaration
We rely on 'set -e' to bail out on errors. We also do a lot of local variable assignments with command substitution like this: local foo=$(bar) However, that masks the return value of the command, failing to bail out on errors. Split up local variable declarations from assignments to avoid the problems. There are no issues with literal assignments like local foo="bar" but split those out too for more uniform code, preferring to have local declarations in the beginning of functions or nested blocks. Details at http://stackoverflow.com/questions/4421257/why-does-local-sweep-the-return-code-of-a-command Signed-off-by:Jani Nikula <jani.nikula@intel.com>
Loading
Please register or sign in to comment