Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support for files that shouldn't be under version control #18

Closed
bradical opened this Issue · 4 comments

2 participants

@bradical

This is more of a question than an issue, but is the share directory intended for files that may contain machine specific passwords or other files that you wouldn't want to be in git?

If not, do you have a standard way to do this in your own commands?

@qrush
Owner

It's more for "data" files, like configuration, templates, etc, that wouldn't otherwise be executable and in the bin directory. I think putting machine-specific passwords in there and a command in bin to parse that out would be fine.

@qrush qrush closed this
@bradical

Thanks for the explanation! Can you explain how putting the command in bin would work? Would this expose the data to all of my sub-commands?

The convention I came up with was to add a /share/<MY_SUB_NAME>/*.properties to my .gitignore and then assume the files are things like mysql.properties.

@bradical

Does everything in bin get loaded? I put some utility functions in a BASH script in there. Is that the correct way to approach it? Do I need to manually load that script?

@bradical

FYI, the way I ended up sharing this utility command was by creating a file in libexec called "prop-loader" with a function load-props:

PROPS_FILE=$_CSD_ROOT/share/csd/mysql.properties
load-props() {
if [ ! -f $PROPS_FILE ];
then
  echo "MySQL properties file not found. Please create a file ${PROPS_FILE} with at least a PASSWORD property. You can copy the mysql.properties.default file" >&2
  exit
fi
source $PROPS_FILE
if [ -z "$PASSWORD" ];
then
  echo "Properties file exists but does not contain PASSWORD. Please add a MySQL password to your properties file in ${PROPS_FILE}" >&2
  exit
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.