Example #1
0
func (this Migration) Execute(request *io.Request, response *io.Response) {
	migrator := scripts.CreateMigrator(request, response, this.connection)
	err := migrator.ApplyAll()
	if err != nil {
		response.AddError(err)
	}
}
Example #2
0
func (pwd Pwd) Execute(request *io.Request, response *io.Response) {
	out, err := exec.Command("sh", "-c", "pwd").Output()
	if err != nil {
		response.AddError(err)
	} else {
		response.AddMessage(string(out))
	}
}
Example #3
0
func (this HelpShower) Execute(request *io.Request, response *io.Response) {
	var helpData help.Container
	if request.InteractorNameEmpty() {
		helpData = help.CreateGeneralHelpContainer(*this.locator)
		response.AddError(errors.New("No interactor name provided"))
	} else {
		interactor := this.locator.GetInteractorByName(request.InteractorName)
		if &interactor == nil {
			response.AddErrorMessage("Cannot show help for an unknown interactor " + request.InteractorName)
			return
		}
		helpData = help.CreateInteractorHelpContainer(interactor)
	}

	helpResponseCreator := &help.HelpResponseCreator{}
	helpResponseCreator.CreateHelpResponse(helpData)
}