blackbox_shred_all_files now changes to root dir before running. Moved similar code from blackbox_postdeploy into _blackbox_common.sh as change_to_root function.

This commit is contained in:
harrison
2014-11-06 00:28:53 -08:00
parent 8f2e8150b5
commit 26ec9319e3
3 changed files with 17 additions and 12 deletions

View File

@@ -390,3 +390,17 @@ function vcs_remove_git() {
function vcs_remove_svn() {
svn delete """$@"""
}
function change_to_root() {
# If BASEDIR is not set, use REPOBASE.
if [[ "$BASEDIR" = "" ]]; then
BASEDIR="$REPOBASE"
fi
if [[ "$BASEDIR" = "/dev/null" ]]; then
echo 'WARNING: Not in a VCS repo. Not changing directory.'
else
echo "CDing to $BASEDIR"
cd "$BASEDIR"
fi
}