fix: center function calling context
This commit is contained in:
1 parent
dd9412ef4f
commit
e9956bd34f
1 file changed
+8
-7
+8
-7
@@ -208,19 +208,20 @@ function run() {
|
|||||||
if (!token) console.warn('No token set in .remote/config.json');
|
if (!token) console.warn('No token set in .remote/config.json');
|
||||||
|
|
||||||
HORDE = new Horde({ host: HOST, token });
|
HORDE = new Horde({ host: HOST, token });
|
||||||
CENTER = new Remote({
|
|
||||||
horde: HORDE,
|
|
||||||
name: CENTER_NAME,
|
|
||||||
functionsDir: path.join(WORK_DIR, '.remote', 'functions'),
|
|
||||||
});
|
|
||||||
REMOTES = new Map([[CENTER_NAME, CENTER]]);
|
|
||||||
|
|
||||||
API = {
|
API = {
|
||||||
createSpace,
|
createSpace,
|
||||||
cloneSpace,
|
cloneSpace,
|
||||||
listSpaces: () => [...REMOTES.keys()].filter((n) => n !== CENTER_NAME),
|
listSpaces: () => [...REMOTES.keys()].filter((n) => n !== CENTER_NAME),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CENTER = new Remote({
|
||||||
|
horde: HORDE,
|
||||||
|
name: CENTER_NAME,
|
||||||
|
functionsDir: path.join(WORK_DIR, '.remote', 'functions'),
|
||||||
|
ctx: { dir: WORK_DIR, remoteName: CENTER_NAME, spaceName: null, api: API },
|
||||||
|
});
|
||||||
|
REMOTES = new Map([[CENTER_NAME, CENTER]]);
|
||||||
|
|
||||||
reconcileSpaces();
|
reconcileSpaces();
|
||||||
new Watcher(spacesDir, () => reconcileSpaces()).start();
|
new Watcher(spacesDir, () => reconcileSpaces()).start();
|
||||||
HORDE.connect();
|
HORDE.connect();
|
||||||
|
|||||||
Reference in new issue
Block a user