command/build: fixes a fatal bug that if pkg.directories exists, cortex build will never callback. fixes #343