public override Command Create() { Command command = new Command("repeatable") { _idOption, _scriptNameOption, }; command.Description = CLITextResources.CreateNewRepeatableScriptFileCommandDescription; command.Handler = CommandHandler.Create <string, string>((id, scriptName) => { _consoleProcessMessages.StartProcessMessage("new repeatable", id); _consoleProcessMessages.StartSpiiner(); ProcessResults processResults = _dbVersionsAPI.CreateNewRepeatableScriptFile(id, scriptName, _consoleProcessMessages.OnNotificationStateChanged); _consoleProcessMessages.StopSpinner(); _consoleProcessMessages.ProcessComplete(processResults); if (!processResults.Trace.HasError) { string newFilePath = (string)processResults.Results; _consoleProcessMessages.SetInfoMessage(CLITextResources.TheFileIsCreatedInfoMessage.Replace("[newFilePath]", newFilePath)); } }); return(command); }
public static ProcessResults CreateNewRepeatableScriptFile(string id, string scriptName, Action <ProcessTrace, StepNotificationState> onNotificationStateChanged) { lock (_processSyncLock) { return(_dbVersionsAPI.CreateNewRepeatableScriptFile(id, scriptName, onNotificationStateChanged)); } }