rmmh / skybot

Python IRC bot
https://github.com/rmmh/skybot/wiki
The Unlicense
249 stars 170 forks source link

Use soft-link-safe chdir #142

Closed socram8888 closed 8 years ago

socram8888 commented 8 years ago

Basically to ease maintenance and reduce issues, I make soft links for relevant folders and files (bot.py, core/ and plugins/util/) in a different folder and then use ./bot.py to run it. This way I can have several different bots running different plugins, and update them all executing a single git pull on the original clean source folder.

sys.path[0] apparently refers to real file rather than link file, so it was accessing the original plugins folder. With this change it will use the path relative to the name as executed by Python. It's exactly the same if you're using a folder of skybot per bot.

rmmh commented 8 years ago

Thanks!