Fixing bash scripts to test for buildpack dir before deletion and reference to buildpack folder