From fa3ff58d9268b208b3eaa5827acd22a313eff6f8 Mon Sep 17 00:00:00 2001 From: William Ting Date: Sun, 25 Jan 2015 16:05:19 +0900 Subject: [PATCH] Add custom sourcing to autojump.sh when using --prefix. Fixes #345. --- bin/autojump | 2 +- install.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/autojump b/bin/autojump index 5673feb..e3d89d6 100755 --- a/bin/autojump +++ b/bin/autojump @@ -60,7 +60,7 @@ from autojump_utils import sanitize from autojump_utils import take from autojump_utils import unico -VERSION = '22.2.2' +VERSION = '22.2.3' FUZZY_MATCH_THRESHOLD = 0.6 TAB_ENTRIES_COUNT = 9 TAB_SEPARATOR = '__' diff --git a/install.py b/install.py index 09fd557..90ea4f9 100755 --- a/install.py +++ b/install.py @@ -29,13 +29,13 @@ def mkdir(path, dryrun=False): 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""" custom_install = "\ \n# check custom install \ \nif [ -s %s/autojump.${shell} ]; then \ - \n\tsource %s/autojump.${shell} \ - \nfi\n" % (etc_dir, etc_dir) + \n source %s/autojump.${shell} \ + \nfi\n" % (share_dir, share_dir) with open(os.path.join(etc_dir, 'autojump.sh'), 'a') as f: f.write(custom_install) @@ -207,7 +207,7 @@ def main(args): cp('./bin/_j', zshshare_dir, args.dryrun) 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)