sshkit v0.3.0 SSHKit.Context View Source

A context encapsulates the environment for the execution of a task. That is:

A context can then be used to run commands, upload or download files: See SSHKit.run/2, SSHKit.upload/3 and SSHKit.download/3.

Link to this section Summary

Functions

Compiles an executable command string for running the given command in the provided context.

Link to this section Functions

Compiles an executable command string for running the given command in the provided context.

Examples

iex> %SSHKit.Context{path: "/var/www"} |> SSHKit.Context.build("ls")
"cd /var/www && /usr/bin/env ls"

iex> %SSHKit.Context{user: "me"} |> SSHKit.Context.build("whoami")
"sudo -H -n -u me -- sh -c '/usr/bin/env whoami'"