Skip to content

Instantly share code, notes, and snippets.

@mpkocher
Last active August 29, 2015 14:02
Show Gist options
  • Save mpkocher/e77e37866f3fa4bed611 to your computer and use it in GitHub Desktop.
Save mpkocher/e77e37866f3fa4bed611 to your computer and use it in GitHub Desktop.
Get current changelist from SEYMOUR_HOME
# Add to .bashrc
function seamour() {
#source $SEYMOUR_HOME/etc/setup.sh
x=`env | grep SEYMOUR_HOME | awk -F "=" '{print $2}'`
source $x/etc/setup.sh
current_version=`get_current_version.sh`
export PS1="[${current_version}]$PS1"
}
#!/bin/bash
# add to $HOME/bin or something better
get_version_from_config_xml () {
if [ -z "$1" ]
then
echo "Unknown"
else
egrep --only-match "build=\"[0-9]*\"" $config_xml | egrep --only-match "[0-9]*" | sort | tail -1
fi
}
config_xml=$SEYMOUR_HOME/etc/config.xml
get_version_from_config_xml $config_xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment