int getVersion() { string pathToDIBMD = $"{getPathToApp()}/{Paths.DIBMD_FILE_RELATIVE_PATH}"; DIBMDHandler handler = new DIBMDHandler(pathToDIBMD); return(handler.GetVersion()); }
string getCompressedFilePath(string repoPath) { DIBMDHandler DIBMDHandler = new DIBMDHandler($"{repoPath}/{Paths.DIBMD_FILE_RELATIVE_PATH}"); string repoName = DIBMDHandler.GetName(); return($"{repoPath}/{repoName + COMPRESSED_FILE_EXTENSION}"); }
void createDIBMDFile(string repoPath, string name, string author, string remote, int port = DEFAULT_PORT) { DIBMDHandler DIBMDHandler = new DIBMDHandler($"{repoPath}/{Paths.DIBMD_FILE_RELATIVE_PATH}"); DIBMDHandler.SetAuthor(author); DIBMDHandler.SetName(name); DIBMDHandler.SetRemoteAddress(remote); DIBMDHandler.SetPort(port); }
public void Upload(string repoPath) { compressRepo(repoPath); string zipPath = getCompressedFilePath(repoPath); DIBMDHandler handler = new DIBMDHandler($"{repoPath}/{Paths.DIBMD_FILE_RELATIVE_PATH}"); System.Console.WriteLine($"curl -F \"files=@{zipPath}\" http://{handler.GetRemoteAddress()}:{handler.GetPort()}/api/dibUpload"); ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = "curl"; startInfo.Arguments = $" -F \"files=@{zipPath}\" http://{handler.GetRemoteAddress()}:{handler.GetPort()}/api/dibUpload"; Process.Start(startInfo); }