static int Git(ConsoleService c, string cmdName, string str) { ConsoleParam[] args = { }; ConsoleParamValueList vl = c.ParseCommandList(cmdName, str, args); if (Lfs.IsDirectoryExists(GitTestBaseDir) == false) { Git_Test_Clone(); } Git_Test_1(); return(0); }
static string GenerateNewRepositoryDirName(string repoUrl) { repoUrl = repoUrl.Trim().ToLower(); string repoName = LinuxParser.GetFileNameWithoutExtension(LinuxParser.RemoveLastSeparatorChar(repoUrl)); DateTime now = DateTime.Now; for (int i = 1; ; i++) { string name = $"{Lfs.PathParser.MakeSafeFileName(repoName)}_{now.Year:D4}{now.Month:D2}{now.Day:D2}_{Env.ProcessId}_{i:D5}"; string fullPath = Lfs.PathParser.Combine(RepoDir, name); if (Lfs.IsDirectoryExists(fullPath) == false) { return(name); } } }