command/build: fixes a bug that err not return;