Merge branch 'cli'
This commit is contained in:
commit
99a3a25131
|
|
@ -234,4 +234,19 @@ program
|
|||
await shell()
|
||||
})
|
||||
|
||||
// Hide and disable commands that don't work over SSH
|
||||
if (process.env.USER === 'cli') {
|
||||
const disabled = ['shell', 'get', 'open']
|
||||
for (const name of disabled) {
|
||||
const cmd = program.commands.find((c) => c.name() === name)
|
||||
if (!cmd) continue
|
||||
cmd.helpInformation = () => ''
|
||||
;(cmd as any)._hidden = true
|
||||
cmd.action(() => {
|
||||
console.error(`"${name}" is not available over SSH`)
|
||||
process.exit(1)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export { program }
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user