comparison install.py @ 473:e368c8ae2a4b

Fix universal ctags config on Windows.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 18 Sep 2019 14:58:18 -0700
parents 97412ea9b3fa
children 91652f4b9752
comparison
equal deleted inserted replaced
472:97412ea9b3fa 473:e368c8ae2a4b
249 ['setx', 'GIT_SSH', 249 ['setx', 'GIT_SSH',
250 '%USERPROFILE%\\Dropbox\\Utilities\\plink.exe'], 250 '%USERPROFILE%\\Dropbox\\Utilities\\plink.exe'],
251 shell=True) 251 shell=True)
252 252
253 253
254 def install_universal_ctags():
255 # On Windows, u-ctags has a bug where it outputs double-backslashes.
256 if is_windows:
257 writelines('~/ctags.d/global.ctags', [
258 '--output-format=e-ctags'
259 ])
260
261
254 @only_on_nix 262 @only_on_nix
255 def install_tmux(): 263 def install_tmux():
256 mklink('tmux/tmux.conf', '~/.tmux.conf') 264 mklink('tmux/tmux.conf', '~/.tmux.conf')
257 265
258 266
416 @supports_forcing 424 @supports_forcing
417 @run_priority(208) 425 @run_priority(208)
418 def install_wintools(cfg, force=False): 426 def install_wintools(cfg, force=False):
419 if not cfg.has_section('wintools'): 427 if not cfg.has_section('wintools'):
420 return 428 return
421 429
422 for name, arch in cfg.items('wintools'): 430 for name, arch in cfg.items('wintools'):
423 args = ['scoop.cmd', 'install', name] 431 args = ['scoop.cmd', 'install', name]
424 if arch: 432 if arch:
425 args += ['-a', arch] 433 args += ['-a', arch]
426 subprocess.check_call(args) 434 subprocess.check_call(args)
428 436
429 # Main stuff! 437 # Main stuff!
430 438
431 class FatalInstallerError(Exception): 439 class FatalInstallerError(Exception):
432 pass 440 pass
433 441
434 442
435 def main(): 443 def main():
436 print("dotfiles installer") 444 print("dotfiles installer")
437 print("python %s" % sys.version) 445 print("python %s" % sys.version)
438 print("on %s" % sys.platform) 446 print("on %s" % sys.platform)
473 help="List available modules to install.") 481 help="List available modules to install.")
474 parser.add_argument( 482 parser.add_argument(
475 '-f', '--force', action='store_true', 483 '-f', '--force', action='store_true',
476 help="Force installation by overwriting things.") 484 help="Force installation by overwriting things.")
477 args = parser.parse_args() 485 args = parser.parse_args()
478 486
479 # Print list and exit if needed. 487 # Print list and exit if needed.
480 if args.list: 488 if args.list:
481 print("Available modules to install:") 489 print("Available modules to install:")
482 for nm in mod_names: 490 for nm in mod_names:
483 print(nm) 491 print(nm)
490 selected_mods = set(args.module) 498 selected_mods = set(args.module)
491 if 'all' in selected_mods: 499 if 'all' in selected_mods:
492 selected_mods = set(mod_names) 500 selected_mods = set(mod_names)
493 selected_mods.remove('all') 501 selected_mods.remove('all')
494 selected_mods.difference_update([neg[3:] for neg in args.module if neg.startswith('no-')]) 502 selected_mods.difference_update([neg[3:] for neg in args.module if neg.startswith('no-')])
495 503
496 for mn in selected_mods: 504 for mn in selected_mods:
497 func = getattr(this_mod, 'install_%s' % mn) 505 func = getattr(this_mod, 'install_%s' % mn)
498 funcs.append((mn, func)) 506 funcs.append((mn, func))
499 # See if there's a local method too for this. 507 # See if there's a local method too for this.
500 if local_mod is not None: 508 if local_mod is not None: