bugfix: correctly run .post script on directories