예제 #1
0
        int getVersion()
        {
            string       pathToDIBMD = $"{getPathToApp()}/{Paths.DIBMD_FILE_RELATIVE_PATH}";
            DIBMDHandler handler     = new DIBMDHandler(pathToDIBMD);

            return(handler.GetVersion());
        }
예제 #2
0
        string getCompressedFilePath(string repoPath)
        {
            DIBMDHandler DIBMDHandler = new DIBMDHandler($"{repoPath}/{Paths.DIBMD_FILE_RELATIVE_PATH}");
            string       repoName     = DIBMDHandler.GetName();

            return($"{repoPath}/{repoName + COMPRESSED_FILE_EXTENSION}");
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }