com.rusanu.DBUtil.SqlCmd.RunCommand C# (CSharp) Method

RunCommand() private method

private RunCommand ( string line, string basePath ) : void
line string
basePath string
return void
		private void RunCommand (string line, string basePath) {
			Regex regFile = new Regex (@":r\s+(?<file>.+)", RegexOptions.IgnoreCase);
			var match = regFile.Match (line);
			if (!match.Success) {
				return;
			}
			var fileMatch = match.Groups ["file"];
			if (fileMatch == null) {
				return;
			}

			var filePath = GetFullFilePath(fileMatch.Value, basePath);
			if (string.IsNullOrEmpty (filePath) || !File.Exists (filePath)) {
				return;
			}

			ExecuteFile (filePath);
		}