-
- All Implemented Interfaces:
-
eu.jrie.jetbrains.kotlinshell.processes.execution.ExecutionContext,eu.jrie.jetbrains.kotlinshell.processes.execution.ProcessExecutionContext,eu.jrie.jetbrains.kotlinshell.shell.ShellBase,eu.jrie.jetbrains.kotlinshell.shell.ShellProcess,eu.jrie.jetbrains.kotlinshell.shell.ShellUtility,eu.jrie.jetbrains.kotlinshell.shell.piping.ShellForking,eu.jrie.jetbrains.kotlinshell.shell.piping.ShellPiping
@ExperimentalCoroutinesApi() public class Shell implements ShellForking, ShellPiping, ShellProcess, ShellUtility
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classShell.Companion
-
Field Summary
Fields Modifier and Type Field Description private final ReceiveChannel<ByteReadPacket>nullinprivate final SendChannel<ByteReadPacket>nulloutprivate final ReceiveChannel<ByteReadPacket>stdinprivate Map<String, String>environmentprivate Map<String, String>variablesprivate Filedirectoryprivate final List<Pair<Integer, Process>>detachedProcessesprivate final List<Process>daemonsprivate final List<Pair<Integer, Pipeline>>detachedPipelinesprivate final SuspendFunction1<ExecutionContext, Unit>jobsprivate final CoroutineScopescopeprivate final ProcessCommandercommanderprivate final SendChannel<ByteReadPacket>stdoutprivate final SendChannel<ByteReadPacket>stderrprivate final SuspendFunction1<ExecutionContext, Unit>envprivate final SuspendFunction1<ExecutionContext, Unit>setprivate final Map<String, String>shellEnvprivate final Map<String, String>systemEnvprivate final List<Process>processesprivate final SuspendFunction1<ExecutionContext, Unit>ps
-
Method Summary
Modifier and Type Method Description final ReceiveChannel<ByteReadPacket>getNullin()Dummy input channel. final SendChannel<ByteReadPacket>getNullout()Dummy output channel. final ReceiveChannel<ByteReadPacket>getStdin()final Map<String, String>getEnvironment()Environment of this shell. final UnitsetEnvironment(Map<String, String> environment)final Map<String, String>getVariables()Variables of this shell. final UnitsetVariables(Map<String, String> variables)final FilegetDirectory()Current directory of this shell final UnitsetDirectory(File directory)List<Pair<Integer, Process>>getDetachedProcesses()List<Process>getDaemons()List<Pair<Integer, Pipeline>>getDetachedPipelines()final SuspendFunction1<ExecutionContext, Unit>getJobs()final CoroutineScopegetScope()CoroutineScope used by this shell, its members and sub shells final ProcessCommandergetCommander()final SendChannel<ByteReadPacket>getStdout()final SendChannel<ByteReadPacket>getStderr()SuspendFunction1<ExecutionContext, Unit>getEnv()SuspendFunction1<ExecutionContext, Unit>getSet()Map<String, String>getShellEnv()Map<String, String>getSystemEnv()List<Process>getProcesses()SuspendFunction1<ExecutionContext, Unit>getPs()Filecd(File dir)Changes directory to given dir Unitvariable(Pair<String, String> variable)Adds new shell variable Unitvariable(Readonly $self, Pair<String, String> variable)Unitexport(Pair<String, String> env)Adds new environment variable Unitexport(Readonly $self, Pair<String, String> env)Unitunset(String key)Removes shell or environmental variable matching given key Processdetach(ProcessExecutable executable)Detaches process from the shell and executes it in the background Pipelinedetach(SuspendFunction1<AbstractPipingDSLShell, Pipeline> pipelineConfig)Creates new Pipeline specified by DSL pipelineConfig and executes it as detached job. UnitjoinDetached()Joins all detached processes final Unitfg(Integer index)Attaches job with given index Unitfg(Process process)Attaches selected Process Unitfg(Pipeline pipeline)Attaches selected Pipeline Processdaemon(ProcessExecutable executable)Unitfinalize()final Unitshell(Map<String, String> vars, File dir, SuspendFunction1<Shell, Unit> script)Pipelinepipeline(ExecutionMode mode, SuspendFunction1<AbstractPipingDSLShell, Pipeline> pipelineConfig)Creates and executes new Pipeline specified by DSL pipelineConfig and executes it in given mode Part of piping DSL -
Methods inherited from class eu.jrie.jetbrains.kotlinshell.shell.piping.ShellPiping
cd, cd, cd, cd, env, file, file, mkdir -
Methods inherited from class eu.jrie.jetbrains.kotlinshell.shell.Shell
byVPID, daemon, detach, forkErr, forkErr, forkErr, forkErr, invoke, invoke, invoke, invoke, join, join, joinAll, kill, kill, killAll, kts, ktsBuilder, ktsProcess, pipelineFork, process, process, running, systemBuilder, systemProcess, systemProcess, systemProcess, terminated -
Methods inherited from class eu.jrie.jetbrains.kotlinshell.shell.piping.ShellForking
byteArrayLambda, contextLambda, emptyByteArray, emptyPacket, packet, packet, packetLambda, streamLambda, stringLambda -
Methods inherited from class eu.jrie.jetbrains.kotlinshell.shell.ShellUtility
closeOut, command, invoke -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getNullin
final ReceiveChannel<ByteReadPacket> getNullin()
Dummy input channel. Behaves like
/dev/null.
-
getNullout
final SendChannel<ByteReadPacket> getNullout()
Dummy output channel. Behaves like
/dev/null.
-
getStdin
final ReceiveChannel<ByteReadPacket> getStdin()
-
getEnvironment
final Map<String, String> getEnvironment()
Environment of this shell. These variables are being inherited to sub shells.
-
setEnvironment
final Unit setEnvironment(Map<String, String> environment)
-
getVariables
final Map<String, String> getVariables()
Variables of this shell. These variables are not being inherited to sub shells.
-
setVariables
final Unit setVariables(Map<String, String> variables)
-
getDirectory
final File getDirectory()
Current directory of this shell
-
setDirectory
final Unit setDirectory(File directory)
-
getDetachedProcesses
List<Pair<Integer, Process>> getDetachedProcesses()
-
getDaemons
List<Process> getDaemons()
-
getDetachedPipelines
List<Pair<Integer, Pipeline>> getDetachedPipelines()
-
getJobs
final SuspendFunction1<ExecutionContext, Unit> getJobs()
-
getScope
final CoroutineScope getScope()
CoroutineScope used by this shell, its members and sub shells
-
getCommander
final ProcessCommander getCommander()
-
getStdout
final SendChannel<ByteReadPacket> getStdout()
-
getStderr
final SendChannel<ByteReadPacket> getStderr()
-
getEnv
SuspendFunction1<ExecutionContext, Unit> getEnv()
-
getSet
SuspendFunction1<ExecutionContext, Unit> getSet()
-
getShellEnv
Map<String, String> getShellEnv()
-
getSystemEnv
Map<String, String> getSystemEnv()
-
getProcesses
List<Process> getProcesses()
-
getPs
SuspendFunction1<ExecutionContext, Unit> getPs()
-
detach
Process detach(ProcessExecutable executable)
Detaches process from the shell and executes it in the background
-
detach
Pipeline detach(SuspendFunction1<AbstractPipingDSLShell, Pipeline> pipelineConfig)
Creates new Pipeline specified by DSL pipelineConfig and executes it as detached job. Part of piping DSL
-
joinDetached
Unit joinDetached()
Joins all detached processes
-
daemon
Process daemon(ProcessExecutable executable)
-
pipeline
Pipeline pipeline(ExecutionMode mode, SuspendFunction1<AbstractPipingDSLShell, Pipeline> pipelineConfig)
Creates and executes new Pipeline specified by DSL pipelineConfig and executes it in given mode Part of piping DSL
-
-
-
-