Example #1
0
File: ctrl.go Project: afajl/ctrl
// Local
func (c Ctrl) LocalCommand(cmdf string, args ...interface{}) (GenericCommand, error) {
	cmd := shell.Command(cmdf, args...)
	cmd.Dir = c.config.LocalCd
	cmd.Shell = c.config.LocalShell
	cmd.Logger = c.log
	err := cmd.SetEnvMap(c.config.LocalEnv)
	return cmd, err
}
Example #2
0
File: ctrl.go Project: afajl/ctrl
func (c Ctrl) localRemoteCommand(cmdf string, args ...interface{}) (GenericCommand, error) {
	cmd := shell.Command(cmdf, args...)
	cmd.Dir = c.host.RemoteCd
	cmd.Shell = c.host.RemoteShell
	cmd.Logger = c.log
	err := cmd.SetEnvMap(c.host.RemoteEnv)
	return cmd, err
}