Support for env-specific plug space primitives
This commit is contained in:
parent
663a15fe33
commit
694448a99b
@ -48,8 +48,11 @@ export class PlugSpacePrimitives implements SpacePrimitives {
|
||||
|
||||
async fetchFileList(): Promise<FileMeta[]> {
|
||||
const allFiles: FileMeta[] = [];
|
||||
for (const { plug, name, operation } of this.hook.spaceFunctions) {
|
||||
if (operation === "listFiles") {
|
||||
for (const { plug, name, operation, env } of this.hook.spaceFunctions) {
|
||||
if (
|
||||
operation === "listFiles" && (!this.env || (env && env === this.env))
|
||||
) {
|
||||
console.log("Going to run this", this.env, env, name, operation);
|
||||
try {
|
||||
for (const pm of await plug.invoke(name, [])) {
|
||||
allFiles.push(pm);
|
||||
|
@ -343,6 +343,7 @@ export class Client {
|
||||
this.plugSpaceRemotePrimitives = new PlugSpacePrimitives(
|
||||
this.remoteSpacePrimitives,
|
||||
this.system.namespaceHook,
|
||||
this.syncMode ? undefined : "client",
|
||||
);
|
||||
|
||||
let fileFilterFn: (s: string) => boolean = () => true;
|
||||
|
Loading…
Reference in New Issue
Block a user