1
0
mirror of https://github.com/wting/autojump synced 2024-09-29 22:40:46 +00:00

Merge remote-tracking branch 'jkuan/git_version' into version_info

Conflicts:
	autojump
This commit is contained in:
Joël Schaerer 2011-09-24 11:36:32 +02:00
commit 8bc532c42f
4 changed files with 22 additions and 1 deletions

View File

@ -27,6 +27,7 @@ from tempfile import NamedTemporaryFile
from operator import itemgetter
import os
AUTOJUMP_VERSION = "release v17"
MAX_KEYWEIGHT = 1000
MAX_STORED_PATHS = 600
COMPLETION_SEPARATOR = '__'
@ -210,7 +211,7 @@ def shell_utility():
"""Run this when autojump is called as a shell utility"""
try:
optlist, args = getopt.getopt(argv[1:], 'a',
['stat', 'import', 'completion', 'bash'])
['stat', 'import', 'completion', 'bash', 'version', 'help'])
except getopt.GetoptError as ex:
print("Unknown command line argument: %s" % ex, file=stderr)
exit(1)
@ -230,6 +231,11 @@ def shell_utility():
output(unico("%.1f:\t%s") % (count, path))
print("Total key weight: %d. Number of stored paths: %d" %
(sum(path_dict.values()), len(paths)))
elif ('--version', '') in optlist:
print("autojump %s" % AUTOJUMP_VERSION)
elif ('--help', '') in optlist:
print("usage: j <dirspec>")
print("where dirspec is a few characters of the directory you want to jump to.")
else:
import re
completion = False

9
git-version.sh Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# add git revision to autojump
gitrevision=`git describe`
if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then
gitrevision=$gitrevision"-dirty"
fi
sed -e "s/^AUTOJUMP_VERSION = \".*\"$/AUTOJUMP_VERSION = \"git revision $gitrevision\"/" autojump > autojump-version
mv -f autojump-version autojump
chmod a+rw autojump

View File

@ -40,6 +40,9 @@ done
echo "Installing to ${prefix} ..."
# add git revision to autojump
./git-version.sh
# INSTALL AUTOJUMP
sudo mkdir -p ${prefix}/share/autojump/
sudo mkdir -p ${prefix}/bin/

View File

@ -39,6 +39,9 @@ done
echo "Installing main files to ${prefix} ..."
# add git revision to autojump
./git-version.sh
sudo mkdir -p ${prefix}/share/autojump/
sudo mkdir -p ${prefix}/bin/
sudo mkdir -p ${prefix}/share/man/man1/