Add version to commands
Add a helper to show the current git SHA of the installed git repo. Signed-off-by: Mike Fiedler <miketheman@gmail.com>
This commit is contained in:
@@ -61,7 +61,7 @@ function reload_plugins() {
|
|||||||
bash-it ()
|
bash-it ()
|
||||||
{
|
{
|
||||||
about 'Bash-it help and maintenance'
|
about 'Bash-it help and maintenance'
|
||||||
param '1: verb [one of: help | show | enable | disable | migrate | update | search ] '
|
param '1: verb [one of: help | show | enable | disable | migrate | update | search | version ] '
|
||||||
param '2: component type [one of: alias(es) | completion(s) | plugin(s) ] or search term(s)'
|
param '2: component type [one of: alias(es) | completion(s) | plugin(s) ] or search term(s)'
|
||||||
param '3: specific component [optional]'
|
param '3: specific component [optional]'
|
||||||
example '$ bash-it show plugins'
|
example '$ bash-it show plugins'
|
||||||
@@ -71,6 +71,7 @@ bash-it ()
|
|||||||
example '$ bash-it migrate'
|
example '$ bash-it migrate'
|
||||||
example '$ bash-it update'
|
example '$ bash-it update'
|
||||||
example '$ bash-it search ruby [[-]rake]... [--enable | --disable]'
|
example '$ bash-it search ruby [[-]rake]... [--enable | --disable]'
|
||||||
|
example '$ bash-it version'
|
||||||
typeset verb=${1:-}
|
typeset verb=${1:-}
|
||||||
shift
|
shift
|
||||||
typeset component=${1:-}
|
typeset component=${1:-}
|
||||||
@@ -90,8 +91,10 @@ bash-it ()
|
|||||||
return;;
|
return;;
|
||||||
update)
|
update)
|
||||||
func=_bash-it_update;;
|
func=_bash-it_update;;
|
||||||
migrate)
|
migrate)
|
||||||
func=_bash-it-migrate;;
|
func=_bash-it-migrate;;
|
||||||
|
version)
|
||||||
|
func=_bash-it-version;;
|
||||||
*)
|
*)
|
||||||
reference bash-it
|
reference bash-it
|
||||||
return;;
|
return;;
|
||||||
@@ -227,6 +230,19 @@ _bash-it-migrate() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_bash-it-version() {
|
||||||
|
_about 'shows current Bash-it version'
|
||||||
|
_group 'lib'
|
||||||
|
|
||||||
|
cd "${BASH_IT}" || return
|
||||||
|
|
||||||
|
echo "Current git SHA:"
|
||||||
|
echo "$(git log --pretty=format:'%h on %aI' -n 1)"
|
||||||
|
|
||||||
|
CURRENT_GIT_SHA=$(git rev-parse --verify HEAD)
|
||||||
|
echo "https://github.com/Bash-it/bash-it/commit/$CURRENT_GIT_SHA"
|
||||||
|
}
|
||||||
|
|
||||||
_bash-it-describe ()
|
_bash-it-describe ()
|
||||||
{
|
{
|
||||||
_about 'summarizes available bash_it components'
|
_about 'summarizes available bash_it components'
|
||||||
|
|||||||
Reference in New Issue
Block a user