From 9d967ad7e8f22c6426d559dd211f1cba766a687e Mon Sep 17 00:00:00 2001 From: Anish Athalye Date: Mon, 11 Jun 2018 21:14:10 -0400 Subject: [PATCH] Include built-in plugins in PyPI distribution --- dotbot/cli.py | 2 +- dotbot/plugins/__init__.py | 3 +++ {plugins => dotbot/plugins}/clean.py | 0 {plugins => dotbot/plugins}/link.py | 0 {plugins => dotbot/plugins}/shell.py | 0 test/tests/plugin-disable-builtin.bash | 17 +++++++++++++++++ 6 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 dotbot/plugins/__init__.py rename {plugins => dotbot/plugins}/clean.py (100%) rename {plugins => dotbot/plugins}/link.py (100%) rename {plugins => dotbot/plugins}/shell.py (100%) create mode 100644 test/tests/plugin-disable-builtin.bash diff --git a/dotbot/cli.py b/dotbot/cli.py index 0674cbe..aec6097 100644 --- a/dotbot/cli.py +++ b/dotbot/cli.py @@ -52,7 +52,7 @@ def main(): log.set_level(Level.DEBUG) plugin_directories = list(options.plugin_dirs) if not options.disable_built_in_plugins: - plugin_directories.append(os.path.join(os.path.dirname(__file__), '..', 'plugins')) + from .plugins import Clean, Link, Shell plugin_paths = [] for directory in plugin_directories: for plugin_path in glob.glob(os.path.join(directory, '*.py')): diff --git a/dotbot/plugins/__init__.py b/dotbot/plugins/__init__.py new file mode 100644 index 0000000..93bd981 --- /dev/null +++ b/dotbot/plugins/__init__.py @@ -0,0 +1,3 @@ +from .clean import Clean +from .link import Link +from .shell import Shell diff --git a/plugins/clean.py b/dotbot/plugins/clean.py similarity index 100% rename from plugins/clean.py rename to dotbot/plugins/clean.py diff --git a/plugins/link.py b/dotbot/plugins/link.py similarity index 100% rename from plugins/link.py rename to dotbot/plugins/link.py diff --git a/plugins/shell.py b/dotbot/plugins/shell.py similarity index 100% rename from plugins/shell.py rename to dotbot/plugins/shell.py diff --git a/test/tests/plugin-disable-builtin.bash b/test/tests/plugin-disable-builtin.bash new file mode 100644 index 0000000..f469b0f --- /dev/null +++ b/test/tests/plugin-disable-builtin.bash @@ -0,0 +1,17 @@ +test_description='can disable built-in plugins' +. '../test-lib.bash' + +test_expect_success 'setup' ' +echo "apple" > ${DOTFILES}/f +' + +test_expect_failure 'run' ' +run_dotbot --disable-built-in-plugins <