Skip to content

Commit

Permalink
fix(plugins/plugin-core-support): remove old "window" commands
Browse files Browse the repository at this point in the history
BREAKING CHANGE: removes window commands

also make quit and exit for electron only

Fixes #5038
  • Loading branch information
starpit committed Jun 30, 2020
1 parent 06cd62b commit 4b7ff87
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 54 deletions.
12 changes: 7 additions & 5 deletions plugins/plugin-core-support/src/lib/cmds/quit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
*/

import { Arguments, Registrar } from '@kui-shell/core'
import { Arguments, Registrar, inBrowser } from '@kui-shell/core'

const doQuit = ({ tab, REPL }: Arguments) => REPL.qexec('tab close', undefined, undefined, { tab })

Expand All @@ -30,12 +30,14 @@ const usage = (command: string) => ({
})

export default (commandTree: Registrar) => {
const quitCmd = commandTree.listen('/quit', doQuit, {
usage: usage('quit')
})
if (!inBrowser()) {
const quitCmd = commandTree.listen('/quit', doQuit, {
usage: usage('quit')
})
}

// just for fun, make /exit a synonym for /quit
commandTree.synonym('/exit', doQuit, quitCmd, {
commandTree.listen('/exit', doQuit, {
usage: usage('exit')
})
}
48 changes: 0 additions & 48 deletions plugins/plugin-core-support/src/lib/cmds/window.ts

This file was deleted.

1 change: 0 additions & 1 deletion plugins/plugin-core-support/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export default async (commandTree: Registrar) => {
if (!isHeadless()) {
await Promise.all([
import('./lib/cmds/zoom').then(_ => _.plugin(commandTree)),
import('./lib/cmds/window').then(_ => _.default(commandTree)),
import('./lib/cmds/theme').then(_ => _.plugin(commandTree))
])
}
Expand Down

0 comments on commit 4b7ff87

Please sign in to comment.