refactoring buildApp funcitonality so its the dir/file to export to rather than a parent file and fixing buildApp command so it exports to the correct location when the default dir cant be deleted