Fix bug when package is not in a git repository + ensure files generated by knitted examples are generated within the output directory