mirror of
https://github.com/corda/corda.git
synced 2025-06-22 09:08:49 +00:00
[ENT-4483] - Make shell welcome message generic (#5758)
This commit is contained in:
committed by
Rick Parker
parent
21a075b727
commit
10e9340871
@ -183,7 +183,7 @@ object InteractiveShell {
|
|||||||
"Commands to extract information about checkpoints stored within the node",
|
"Commands to extract information about checkpoints stored within the node",
|
||||||
CheckpointShellCommand::class.java
|
CheckpointShellCommand::class.java
|
||||||
)
|
)
|
||||||
shell = ShellLifecycle(configuration.commandsDirectory).start(config, configuration.user, configuration.password, runSshDaemon)
|
shell = ShellLifecycle(configuration.commandsDirectory).start(config, configuration.user, configuration.password)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun runLocalShell(onExit: () -> Unit = {}) {
|
fun runLocalShell(onExit: () -> Unit = {}) {
|
||||||
@ -211,7 +211,7 @@ object InteractiveShell {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ShellLifecycle(private val shellCommands: Path) : PluginLifeCycle() {
|
class ShellLifecycle(private val shellCommands: Path) : PluginLifeCycle() {
|
||||||
fun start(config: Properties, localUserName: String = "", localUserPassword: String = "", runSshDaemon: Boolean): Shell {
|
fun start(config: Properties, localUserName: String = "", localUserPassword: String = ""): Shell {
|
||||||
val classLoader = this.javaClass.classLoader
|
val classLoader = this.javaClass.classLoader
|
||||||
val classpathDriver = ClassPathMountFactory(classLoader)
|
val classpathDriver = ClassPathMountFactory(classLoader)
|
||||||
val fileDriver = FileMountFactory(Utils.getCurrentDirectory())
|
val fileDriver = FileMountFactory(Utils.getCurrentDirectory())
|
||||||
@ -237,8 +237,7 @@ object InteractiveShell {
|
|||||||
return super.getPlugins().filterNot { it is JavaLanguage } + CordaAuthenticationPlugin(rpcOps)
|
return super.getPlugins().filterNot { it is JavaLanguage } + CordaAuthenticationPlugin(rpcOps)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val attributes = mutableMapOf<String, Any>()
|
val attributes = emptyMap<String, Any>()
|
||||||
attributes["crash.localShell"] = runSshDaemon
|
|
||||||
val context = PluginContext(discovery, attributes, commandsFS, confFS, classLoader)
|
val context = PluginContext(discovery, attributes, commandsFS, confFS, classLoader)
|
||||||
context.refresh()
|
context.refresh()
|
||||||
this.config = config
|
this.config = config
|
||||||
|
@ -4,21 +4,12 @@ package net.corda.tools.shell.base
|
|||||||
// given in the configuration code in InteractiveShell.
|
// given in the configuration code in InteractiveShell.
|
||||||
|
|
||||||
welcome = { ->
|
welcome = { ->
|
||||||
if (crash.context.attributes["crash.localShell"] == true) {
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
Welcome to the Corda interactive shell.
|
Welcome to the Corda interactive shell.
|
||||||
Useful commands include 'help' to see what is available, and 'bye' to exit the shell.
|
You can see the available commands by typing 'help'.
|
||||||
|
|
||||||
""".stripIndent()
|
""".stripIndent()
|
||||||
} else {
|
|
||||||
"""
|
|
||||||
|
|
||||||
Welcome to the Corda interactive shell.
|
|
||||||
Useful commands include 'help' to see what is available, and 'bye' to shut down the node.
|
|
||||||
|
|
||||||
""".stripIndent()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
prompt = { ->
|
prompt = { ->
|
||||||
|
Reference in New Issue
Block a user