1
0

Fix plug space filtering (again)

This commit is contained in:
Zef Hemel 2023-12-20 14:56:15 +01:00
parent a1e2d747d5
commit 1a86c5b326

View File

@ -32,10 +32,18 @@ export class PlugSpacePrimitives implements SpacePrimitives {
for ( for (
const { operation, pattern, plug, name, env } of this.hook.spaceFunctions const { operation, pattern, plug, name, env } of this.hook.spaceFunctions
) { ) {
// console.log("Going to match agains pattern", pattern, path); // console.log(
// "Going to match agains pattern",
// operation,
// pattern,
// path,
// this.env,
// env,
// );
if ( if (
operation === type && path.match(pattern) && operation === type && path.match(pattern) &&
(!this.env || (env && env === this.env)) // Both envs are set, and they don't match
(!this.env || !env || env === this.env)
) { ) {
return plug.invoke(name, [path, ...args]); return plug.invoke(name, [path, ...args]);
} }