Updating clean and generate tasks to raise errors

Prior to this commit most of the shell commands that were called were
not being checked for errors. This update should do a better job of
failing early when the generate task encounters an unexpected state.