Ver a proveniência

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

Conflicts:
	autojump
pull/72/merge
Joël Schaerer há 13 anos
ascendente
cometimento
8bc532c42f
4 ficheiros alterados com 22 adições e 1 eliminações
  1. +7
    -1
      autojump
  2. +9
    -0
      git-version.sh
  3. +3
    -0
      install.sh
  4. +3
    -0
      install.zsh

+ 7
- 1
autojump Ver ficheiro

@ -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
- 0
git-version.sh Ver ficheiro

@ -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

+ 3
- 0
install.sh Ver ficheiro

@ -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/

+ 3
- 0
install.zsh Ver ficheiro

@ -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/

Carregando…
Cancelar
Guardar