Skip to content

Commit c6ba129

Browse files
authored
Filter blank plugin directories (#2187)
I neglected to realize that "".split(":") is an array with "" in it.
1 parent 811cf33 commit c6ba129

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/node/plugin.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,18 @@ export const loadPlugins = async (httpServer: HttpServer, args: Args): Promise<v
7575
// Built-in plugins.
7676
_loadPlugins(path.resolve(__dirname, "../../plugins"), httpServer, args),
7777
// User-added plugins.
78-
...pluginPath.split(":").map((dir) => _loadPlugins(path.resolve(dir), httpServer, args)),
78+
...pluginPath
79+
.split(":")
80+
.filter((p) => !!p)
81+
.map((dir) => _loadPlugins(path.resolve(dir), httpServer, args)),
7982
// Individual plugins so you don't have to symlink or move them into a
8083
// directory specifically for plugins. This lets you load plugins that are
8184
// on the same level as other directories that are not plugins (if you tried
8285
// to use CS_PLUGIN_PATH code-server would try to load those other
8386
// directories as plugins). Intended for development.
84-
...plugin.split(":").map((dir) => loadPlugin(path.resolve(dir), httpServer, args)),
87+
...plugin
88+
.split(":")
89+
.filter((p) => !!p)
90+
.map((dir) => loadPlugin(path.resolve(dir), httpServer, args)),
8591
])
8692
}

0 commit comments

Comments
 (0)