errbotio / errbot

Errbot is a chatbot, a daemon that connects to your favorite chat service and bring your tools and some fun into the conversation.
http://errbot.io
GNU General Public License v3.0
3.12k stars 614 forks source link

Make example_plugin_dir using not directly base_dir #1511

Closed attakei closed 3 years ago

attakei commented 3 years ago

This is for fix to #1510.

Base thinking for fix (python repl):

>>> from pathlib import Path
>>> base_dir = Path("foo")
>>> extra_plugin_dir = base_dir / "plugins"

>>> example_plugin_dir = base_dir / extra_plugin_dir / "err-example"
>>> example_plugin_dir
PosixPath('foo/foo/plugins/err-example')

>>> example_plugin_dir = extra_plugin_dir / "err-example"
>>> example_plugin_dir
PosixPath('foo/plugins/err-example')
attakei commented 3 years ago

I think base_dir should be created absolute path even if it passed any values of arguments. (not changed in commit)

example:

-base_dir = pathlib.Path.cwd() if args["init"] == "." else Path(args["init"])
+base_dir = pathlib.Path.cwd() if args["init"] == "." else Path(args["init"]).resolve()