Exemple #1
0
        private static void RunBattle(string agent,
                                      string[] battle)
        {
            const string dir           = @"C:\LambdaContest\distr\Referee\bin\Debug\";
            var          exe           = Path.Combine(dir, "Referee.exe");
            var          parameters    = string.Join(" ", battle);
            var          a             = ProcessHelpers.ExecuteCommand($"PsExec64 \\\\{agent} -w {dir} {exe} {parameters}", ProcessHelpers.FailIfError, Environment.CurrentDirectory);
            var          resultsFolder = Path.Combine(GetAgentDistrFolder(agent), @"Referee\bin\Debug\Results");

            RoboCopy(resultsFolder, "Results");
        }
Exemple #2
0
        public static string RoboCopy(string sourceDir,
                                      string destinationDir,
                                      IEnumerable <string> includedFilesFilter = null,
                                      IEnumerable <string> excludedFilesFilter = null,
                                      string additionalOptions = null)
        {
            var include = includedFilesFilter != null
                              ? string.Join(" ", includedFilesFilter.Select(x => $"\"{x}\""))
                              : "";

            var exclude = excludedFilesFilter != null
                              ? string.Format("/xd {0}", string.Join(" ", excludedFilesFilter.Select(x => $"\"{x}\"")))
                              : "";

            var parameters = string.Format(@"""{0}"" ""{1}"" /r:10 /w:2 /fft {2} /e /xo {3}{4}", PathHelpers.ExcludeTrailingSlash(sourceDir),
                                           PathHelpers.ExcludeTrailingSlash(destinationDir), include, exclude,
                                           additionalOptions);

            return(ProcessHelpers.ExecuteCommand("robocopy.exe " + parameters, result => result.ExitCode >= 8, Environment.CurrentDirectory));
        }