Simpllify the build method of ShellTask.

No need for so many if statements, thanks CodeClimate!