balta2ar / brotab

Control your browser's tabs from the command line
MIT License
389 stars 27 forks source link

`by install` fails if `bt_mediator` is not in path. #46

Open jamespharvey20 opened 3 years ago

jamespharvey20 commented 3 years ago

I ran:

Traceback (most recent call last):
  File "/home/mdarling/.local/bin/bt", line 8, in <module>
    sys.exit(main())
  File "/home/mdarling/.local/lib/python3.8/site-packages/brotab/main.py", line 670, in main
    exit(run_commands(sys.argv[1:]))
  File "/home/mdarling/.local/lib/python3.8/site-packages/brotab/main.py", line 663, in run_commands
    result = args.func(args)
  File "/home/mdarling/.local/lib/python3.8/site-packages/brotab/main.py", line 352, in install_mediator
    manifest = template.replace(r'$PWD/brotab_mediator.py', bt_mediator_path)
TypeError: replace() argument 2 must be str, not None

This happens because of line 327:

    bt_mediator_path = shutil.which('bt_mediator')

Because I had not yet added ~/local/bin to my path, which returns nothing. Obviously, adding it to my path is the fix for me. But, it might be worth: