当前位置: 首页>>代码示例>>C#>>正文


C# FilePath.Call方法代码示例

本文整理汇总了C#中FilePath.Call方法的典型用法代码示例。如果您正苦于以下问题:C# FilePath.Call方法的具体用法?C# FilePath.Call怎么用?C# FilePath.Call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FilePath的用法示例。


在下文中一共展示了FilePath.Call方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PullCurrentBranch

        public void PullCurrentBranch(FilePath modulePath, int times = 0)
        {
            string branch = "";
            modulePath.Call(_git, "status --branch --short", (o, e) =>
            {
                branch = GuessBranch(o + e);
            });

            TryGitCommand(modulePath, times, "pull --ff-only --verbose origin " + branch);
            TryGitCommand(modulePath, times, "submodule update --init");
        }
开发者ID:i-e-b,项目名称:PlatformBuild,代码行数:11,代码来源:Git.cs

示例2: Build

        public int Build(FilePath rootPath, FilePath buildPath)
        {
            var path = _files.GetFirstMatch(buildPath, _patterns.BuildPattern);
            if (path == null) return 0;

            foreach (var copyPath in _patterns.CopyPaths)
            {
                var src = rootPath.Navigate(copyPath.Source);
                var dst = buildPath.Navigate(copyPath.Destination);
                if (_files.Exists(src))
                    _files.CopyDirectory(src, dst);
            }

            var command = string.Format(_patterns.BuildCmd, path.LastElement());
            Log.Verbose(command);

            return buildPath.Call("cmd", "/c " + command);
        }
开发者ID:i-e-b,项目名称:PlatformBuild,代码行数:18,代码来源:BuildCmd.cs

示例3: TryGitCommand

 void TryGitCommand(FilePath modulePath, int times, string command)
 {
     if (times > 3)
     {
         Log.Status("Git server keeps hanging up. Will continue with local copy");
         return;
     }
     string s_out = "";
     string s_err = "";
     if (modulePath.Call(_git, command, (o, e) =>
         {
             s_err = e;
             s_out = o;
         }) != 0)
     {
         if (
             s_err.Contains(FatalHangup) || s_out.Contains(FatalHangup)
             ||
             s_err.Contains(FatalConnect) || s_out.Contains(FatalConnect)
             )
         {
             TryGitCommand(modulePath, times + 1, command);
         }
         else throw new Exception("Git pull failed on " + modulePath.ToEnvironmentalPath() + "; Please resolve and try again");
     }
 }
开发者ID:i-e-b,项目名称:PlatformBuild,代码行数:26,代码来源:Git.cs

示例4: PullMaster

 public void PullMaster(FilePath repoDir)
 {
     repoDir.Call(_git, "pull --ff-only --verbose origin master");
 }
开发者ID:i-e-b,项目名称:PlatformBuild,代码行数:4,代码来源:Git.cs

示例5: Clone

 public void Clone(FilePath repoDir, FilePath filePath, string repo)
 {
     repoDir.Call(_git, "clone " + repo + " " + filePath.Unroot(repoDir).ToPosixPath());
 }
开发者ID:i-e-b,项目名称:PlatformBuild,代码行数:4,代码来源:Git.cs

示例6: CheckoutFolder

 public void CheckoutFolder(FilePath path)
 {
     path.Call(_git, "checkout . --theirs");
 }
开发者ID:i-e-b,项目名称:PlatformBuild,代码行数:4,代码来源:Git.cs

示例7: RebuildByFluentMigration

        private void RebuildByFluentMigration(FilePath projPath, FilePath psScript)
        {
            var createDatabase = projPath.Append(new FilePath("DatabaseScripts")).Append(new FilePath("CreateDatabase.sql"));
            Log.Status("Creating database from " + createDatabase.ToEnvironmentalPath());
            _builder.RunSqlScripts(projPath, createDatabase);

            Log.Status("Running RunMigrationsLocally.ps1");
            projPath.Call("powershell " + psScript.ToEnvironmentalPath(), "");
        }
开发者ID:i-e-b,项目名称:PlatformBuild,代码行数:9,代码来源:Builder.cs

示例8: RunSqlScripts

 public int RunSqlScripts(FilePath root, FilePath script)
 {
     Log.Status("                           " + script.LastElement());
     return root.Call("sqlcmd.exe", "-f 65001 -i \"" + script.ToEnvironmentalPath() + "\" -S . -E");
 }
开发者ID:i-e-b,项目名称:PlatformBuild,代码行数:5,代码来源:BuildCmd.cs


注:本文中的FilePath.Call方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。