1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

Add custom sourcing to autojump.sh when using --prefix.

Fixes #345.
This commit is contained in:
William Ting 2015-01-25 16:05:19 +09:00
parent 53683525d2
commit fa3ff58d92
2 changed files with 5 additions and 5 deletions

View File

@ -60,7 +60,7 @@ from autojump_utils import sanitize
from autojump_utils import take from autojump_utils import take
from autojump_utils import unico from autojump_utils import unico
VERSION = '22.2.2' VERSION = '22.2.3'
FUZZY_MATCH_THRESHOLD = 0.6 FUZZY_MATCH_THRESHOLD = 0.6
TAB_ENTRIES_COUNT = 9 TAB_ENTRIES_COUNT = 9
TAB_SEPARATOR = '__' TAB_SEPARATOR = '__'

View File

@ -29,13 +29,13 @@ def mkdir(path, dryrun=False):
os.makedirs(path) os.makedirs(path)
def modify_autojump_sh(etc_dir, dryrun=False): def modify_autojump_sh(etc_dir, share_dir, dryrun=False):
"""Append custom installation path to autojump.sh""" """Append custom installation path to autojump.sh"""
custom_install = "\ custom_install = "\
\n# check custom install \ \n# check custom install \
\nif [ -s %s/autojump.${shell} ]; then \ \nif [ -s %s/autojump.${shell} ]; then \
\n\tsource %s/autojump.${shell} \ \n source %s/autojump.${shell} \
\nfi\n" % (etc_dir, etc_dir) \nfi\n" % (share_dir, share_dir)
with open(os.path.join(etc_dir, 'autojump.sh'), 'a') as f: with open(os.path.join(etc_dir, 'autojump.sh'), 'a') as f:
f.write(custom_install) f.write(custom_install)
@ -207,7 +207,7 @@ def main(args):
cp('./bin/_j', zshshare_dir, args.dryrun) cp('./bin/_j', zshshare_dir, args.dryrun)
if args.custom_install: if args.custom_install:
modify_autojump_sh(etc_dir, args.dryrun) modify_autojump_sh(etc_dir, share_dir, args.dryrun)
show_post_installation_message(etc_dir, share_dir, bin_dir) show_post_installation_message(etc_dir, share_dir, bin_dir)