mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
Merge remote-tracking branch 'jkuan/git_version' into version_info
Conflicts: autojump
This commit is contained in:
commit
8bc532c42f
8
autojump
8
autojump
@ -27,6 +27,7 @@ from tempfile import NamedTemporaryFile
|
|||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
AUTOJUMP_VERSION = "release v17"
|
||||||
MAX_KEYWEIGHT = 1000
|
MAX_KEYWEIGHT = 1000
|
||||||
MAX_STORED_PATHS = 600
|
MAX_STORED_PATHS = 600
|
||||||
COMPLETION_SEPARATOR = '__'
|
COMPLETION_SEPARATOR = '__'
|
||||||
@ -210,7 +211,7 @@ def shell_utility():
|
|||||||
"""Run this when autojump is called as a shell utility"""
|
"""Run this when autojump is called as a shell utility"""
|
||||||
try:
|
try:
|
||||||
optlist, args = getopt.getopt(argv[1:], 'a',
|
optlist, args = getopt.getopt(argv[1:], 'a',
|
||||||
['stat', 'import', 'completion', 'bash'])
|
['stat', 'import', 'completion', 'bash', 'version', 'help'])
|
||||||
except getopt.GetoptError as ex:
|
except getopt.GetoptError as ex:
|
||||||
print("Unknown command line argument: %s" % ex, file=stderr)
|
print("Unknown command line argument: %s" % ex, file=stderr)
|
||||||
exit(1)
|
exit(1)
|
||||||
@ -230,6 +231,11 @@ def shell_utility():
|
|||||||
output(unico("%.1f:\t%s") % (count, path))
|
output(unico("%.1f:\t%s") % (count, path))
|
||||||
print("Total key weight: %d. Number of stored paths: %d" %
|
print("Total key weight: %d. Number of stored paths: %d" %
|
||||||
(sum(path_dict.values()), len(paths)))
|
(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:
|
else:
|
||||||
import re
|
import re
|
||||||
completion = False
|
completion = False
|
||||||
|
9
git-version.sh
Executable file
9
git-version.sh
Executable 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
|
@ -40,6 +40,9 @@ done
|
|||||||
|
|
||||||
echo "Installing to ${prefix} ..."
|
echo "Installing to ${prefix} ..."
|
||||||
|
|
||||||
|
# add git revision to autojump
|
||||||
|
./git-version.sh
|
||||||
|
|
||||||
# INSTALL AUTOJUMP
|
# INSTALL AUTOJUMP
|
||||||
sudo mkdir -p ${prefix}/share/autojump/
|
sudo mkdir -p ${prefix}/share/autojump/
|
||||||
sudo mkdir -p ${prefix}/bin/
|
sudo mkdir -p ${prefix}/bin/
|
||||||
|
@ -39,6 +39,9 @@ done
|
|||||||
|
|
||||||
echo "Installing main files to ${prefix} ..."
|
echo "Installing main files to ${prefix} ..."
|
||||||
|
|
||||||
|
# add git revision to autojump
|
||||||
|
./git-version.sh
|
||||||
|
|
||||||
sudo mkdir -p ${prefix}/share/autojump/
|
sudo mkdir -p ${prefix}/share/autojump/
|
||||||
sudo mkdir -p ${prefix}/bin/
|
sudo mkdir -p ${prefix}/bin/
|
||||||
sudo mkdir -p ${prefix}/share/man/man1/
|
sudo mkdir -p ${prefix}/share/man/man1/
|
||||||
|
Loading…
Reference in New Issue
Block a user