Skip to content

Commit

Permalink
🐚: fix accidentally sharing of client and server command array
Browse files Browse the repository at this point in the history
  • Loading branch information
merryman authored and linusha committed Dec 13, 2023
1 parent cf9b9a6 commit c0dbabd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lively.shell/client-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ import { signal } from 'lively.bindings';

let debug = false;

let _commands;
_commands = _commands || [];

export default class ClientCommand extends CommandInterface {
static installLively2LivelyServices (l2lClient) {
Object.keys(L2LServices).forEach(name => // eslint-disable-line no-use-before-define
l2lClient.addService(name,
async (tracker, msg, ackFn) => L2LServices[name](tracker, msg, ackFn))); // eslint-disable-line no-use-before-define
}

static get commands () {
return _commands;
}

constructor (l2lClient) {
super();
this.debug = debug;
Expand Down
7 changes: 7 additions & 0 deletions lively.shell/server-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ function pkillKill (pid, signal, thenDo) {
});
}

let _commands;
_commands = _commands || [];

// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// var c = new Command();
// c.spawn({command: "ls"})
Expand All @@ -61,6 +64,10 @@ export default class ServerCommand extends CommandInterface {
async (tracker, msg, ackFn) => L2LServices[name](tracker, msg, ackFn))); // eslint-disable-line no-use-before-define
}

static get commands () {
return _commands;
}

constructor () {
super();
this.debug = debug;
Expand Down

0 comments on commit c0dbabd

Please sign in to comment.