diff --git a/src/commands/index.js b/src/commands/index.js index fad516a6..1022021c 100644 --- a/src/commands/index.js +++ b/src/commands/index.js @@ -69,8 +69,11 @@ const all: Array> = [ uninstallApp, ] +export const commandsById = {} + all.forEach(cmd => { invariant(!all.some(c => c !== cmd && c.id === cmd.id), `duplicate command '${cmd.id}'`) + commandsById[cmd.id] = cmd }) export default all diff --git a/src/renderer/init.js b/src/renderer/init.js index 4f7278df..0cd10074 100644 --- a/src/renderer/init.js +++ b/src/renderer/init.js @@ -18,6 +18,7 @@ import { fetchAccounts } from 'actions/accounts' import { fetchSettings } from 'actions/settings' import { lock } from 'reducers/application' import { languageSelector, sentryLogsSelector } from 'reducers/settings' +import { commandsById } from 'commands' import libcoreGetVersion from 'commands/libcoreGetVersion' import resolveUserDataDirectory from 'helpers/resolveUserDataDirectory' @@ -111,6 +112,14 @@ async function init() { }, false, ) + + // expose stuff in Windows for DEBUG purpose + + window.ledger = { + commands: commandsById, + store, + db, + } } function r(Comp) {