summary refs log tree commit diff
path: root/maintainers/scripts
diff options
context:
space:
mode:
authorMatthieu Coudron <teto@users.noreply.github.com>2022-05-03 21:14:31 +0200
committerGitHub <noreply@github.com>2022-05-03 21:14:31 +0200
commit27103e676a9b585ee1c406401073495d4f7b546a (patch)
tree03df2f08dbd2cb7150c5176a8b67d754d4e1210d /maintainers/scripts
parentf1531b1b825101dc68395de89846e64a2bb182fe (diff)
parent21f526a7f33f5c689260ee8e992d954fd7188d3b (diff)
Merge pull request #171322 from teto/build-neovim-plugin
distinguish between vim/neovim plugins
Diffstat (limited to 'maintainers/scripts')
-rw-r--r--maintainers/scripts/pluginupdate.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/maintainers/scripts/pluginupdate.py b/maintainers/scripts/pluginupdate.py
index b24d75a6b4d0d..55eda3c7d45d7 100644
--- a/maintainers/scripts/pluginupdate.py
+++ b/maintainers/scripts/pluginupdate.py
@@ -311,6 +311,16 @@ def load_plugins_from_csv(config: FetchConfig, input_file: Path,) -> List[Plugin
 
     return plugins
 
+def run_nix_expr(expr):
+    with CleanEnvironment():
+        cmd = ["nix", "eval", "--extra-experimental-features",
+                "nix-command", "--impure", "--json", "--expr", expr]
+        log.debug("Running command %s", cmd)
+        out = subprocess.check_output(cmd)
+    data = json.loads(out)
+    return data
+
+
 class Editor:
     """The configuration of the update script."""
 
@@ -333,13 +343,9 @@ class Editor:
         self.deprecated = deprecated or root.joinpath("deprecated.json")
         self.cache_file = cache_file or f"{name}-plugin-cache.json"
 
-    def get_current_plugins(editor) -> List[Plugin]:
+    def get_current_plugins(self) -> List[Plugin]:
         """To fill the cache"""
-        with CleanEnvironment():
-            cmd = ["nix", "eval", "--extra-experimental-features", "nix-command", "--impure", "--json", "--expr", editor.get_plugins]
-            log.debug("Running command %s", cmd)
-            out = subprocess.check_output(cmd)
-        data = json.loads(out)
+        data = run_nix_expr(self.get_plugins)
         plugins = []
         for name, attr in data.items():
             print("get_current_plugins: name %s" % name)