FMCorz/mdk — pull request #72 by andrewnicols (2014-01-15 04:31:39+00:00)
Title: Allow a list of aliases when specifying an alias

Sometimes it is useful to run multiple commands as part of an alias, for
example when changing a setting you may wish to then run purge.

mdk run rtl

"aliases": {
"rtl": [
"!sed -e 's/ltr/rtl/' -i '' lang/en/langconfig.php",
"purge"
],
"ltr": [
"!sed -e 's/rtl/ltr/' -i '' lang/en/langconfig.php",
"purge"
]
}

With this change:

* if the command returns a list, we run the mdk command;
* otherwise, if it returns a non-zero return code then we exit immediately;
* and if it's not a list and it's zero, we continue to the next command

This way, if a command in the middle returns an error, we stop processing; but otherwise we continue. We maintain the same behaviour if a list was not used.