mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
Do not write files when in dry run
This commit is contained in:
parent
06e082c918
commit
cea75c27fe
@ -37,6 +37,7 @@ def modify_autojump_sh(etc_dir, share_dir, dryrun=False):
|
|||||||
\n source %s/autojump.${shell} \
|
\n source %s/autojump.${shell} \
|
||||||
\nfi\n' % (share_dir, share_dir)
|
\nfi\n' % (share_dir, share_dir)
|
||||||
|
|
||||||
|
if not dryrun:
|
||||||
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)
|
||||||
|
|
||||||
@ -48,6 +49,7 @@ def modify_autojump_lua(clink_dir, bin_dir, dryrun=False):
|
|||||||
'\\\\',
|
'\\\\',
|
||||||
)
|
)
|
||||||
clink_file = os.path.join(clink_dir, 'autojump.lua')
|
clink_file = os.path.join(clink_dir, 'autojump.lua')
|
||||||
|
if not dryrun:
|
||||||
with open(clink_file, 'r') as f:
|
with open(clink_file, 'r') as f:
|
||||||
original = f.read()
|
original = f.read()
|
||||||
with open(clink_file, 'w') as f:
|
with open(clink_file, 'w') as f:
|
||||||
|
Loading…
Reference in New Issue
Block a user