本文整理汇总了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");
}
示例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);
}
示例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");
}
}
示例4: PullMaster
public void PullMaster(FilePath repoDir)
{
repoDir.Call(_git, "pull --ff-only --verbose origin master");
}
示例5: Clone
public void Clone(FilePath repoDir, FilePath filePath, string repo)
{
repoDir.Call(_git, "clone " + repo + " " + filePath.Unroot(repoDir).ToPosixPath());
}
示例6: CheckoutFolder
public void CheckoutFolder(FilePath path)
{
path.Call(_git, "checkout . --theirs");
}
示例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(), "");
}
示例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");
}