import dotfile(s) from paths
(opts)
| 527 | |
| 528 | |
| 529 | def cmd_importer(opts): |
| 530 | """import dotfile(s) from paths""" |
| 531 | ret = True |
| 532 | cnt = 0 |
| 533 | paths = opts.import_path |
| 534 | importer = Importer(opts.profile, opts.conf, |
| 535 | opts.dotpath, opts.diff_command, |
| 536 | opts.variables, |
| 537 | dry=opts.dry, safe=opts.safe, |
| 538 | debug=opts.debug, |
| 539 | keepdot=opts.keepdot, |
| 540 | ignore=opts.import_ignore, |
| 541 | forcekey=opts.import_force_key) |
| 542 | |
| 543 | for path in paths: |
| 544 | tmpret = importer.import_path(path, |
| 545 | import_as=opts.import_as, |
| 546 | import_link=opts.import_link, |
| 547 | import_mode=opts.import_mode, |
| 548 | trans_install=opts.import_trans_install, |
| 549 | trans_update=opts.import_trans_update) |
| 550 | if tmpret < 0: |
| 551 | ret = False |
| 552 | elif tmpret > 0: |
| 553 | cnt += 1 |
| 554 | |
| 555 | if opts.dry: |
| 556 | LOG.dry('new config file would be:') |
| 557 | LOG.raw(opts.conf.dump()) |
| 558 | else: |
| 559 | opts.conf.save() |
| 560 | LOG.log(f'\n{cnt} file(s) imported.') |
| 561 | |
| 562 | return ret |
| 563 | |
| 564 | |
| 565 | def cmd_list_profiles(opts): |