openshift-evangelists / oc-cluster-wrapper

oc cluster up bash wrapper
Apache License 2.0
144 stars 72 forks source link

Tests for existence of directory not necessary. #2

Closed GrahamDumpleton closed 8 years ago

GrahamDumpleton commented 8 years ago

In:

  if test ! -d $OPENSHIFT_HOST_CONFIG_DIR; then
     mkdir -p $OPENSHIFT_HOST_CONFIG_DIR
  fi

  if test ! -d $OPENSHIFT_HOST_DATA_DIR; then
    mkdir -p $OPENSHIFT_HOST_DATA_DIR
  fi

  if test ! -d $OPENSHIFT_HOST_VOLUMES_DIR; then
    mkdir -p $OPENSHIFT_HOST_VOLUMES_DIR
  fi

the if test check is not needed as mkdir -p will not complain if directory already exists anyway.

This is my fault as you copied what I had.

GrahamDumpleton commented 8 years ago

Same in functions for creating volumes:

  if test ! -d $__path; then
    mkdir -p $__path
  fi
jorgemoralespou commented 8 years ago

I copied this from your blog. I thought that if you used it it had some value. That's my confidence in you. 😂😂😂

El 23 sept. 2016 3:44, "Graham Dumpleton" notifications@github.com escribió:

Same in functions for creating volumes:

if test ! -d $path; then mkdir -p $path fi

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jorgemoralespou/oc-cluster-wrapper/issues/2#issuecomment-249079187, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEyDnNIPnBdOvpiUin8Qi1VXGCR_5Mtks5qsy79gaJpZM4KEhq3 .

jorgemoralespou commented 8 years ago

Fixed