command/build: removes the existing built folder when cortex build; fixes #477