brona / iproute2mac

CLI wrapper for basic network utilites on Mac OS X inspired with iproute2 on Linux systems - ip command.
MIT License
898 stars 73 forks source link

fix: add execution folder to import path #58

Closed iloveitaly closed 2 months ago

iloveitaly commented 2 months ago

without this, I get the following error:

/opt/homebrew/Cellar/iproute2mac/1.5.2/libexec master ❯ ls .rwxr-xr-x 7.2k mike 13 Aug 13:17 bridge .rwxr-xr-x 21k mike 13 Aug 13:17 ip .rw-r--r-- 3.3k mike 13 Aug 13:17 iproute2mac.py

/opt/homebrew/Cellar/iproute2mac/1.5.2/libexec master ❯ ip route get 1.1.1.1 Traceback (most recent call last): File "/opt/homebrew/Cellar/iproute2mac/1.5.2/libexec/ip", line 13, in from iproute2mac import * ModuleNotFoundError: No module named 'iproute2mac'

brona commented 2 months ago

Thank you for the PR, however I am unable to reproduce on my end (Mac OS 14.5, Homebrew), I guess there must be something specific about your installation or env.

Can you please first create Github issue and document a bit more your env?

I am not sure why it doesn't work in your case, since elsewhere the $PATH propagates without any problems (the import is in the same directory as the script itself) + it is invoked via the exec script...