command/build: fixes a fatal bug that directories.dist should not published as a folder; fixes #385