packaging

This commit is contained in:
2019-06-24 14:30:47 +01:00
parent 8e16b77575
commit ef4c7f87c4
14 changed files with 61 additions and 21 deletions

View File

@ -19,23 +19,16 @@ namespace Yavsc.Server.Models.IT.SourceCode
// Model annotations => input.Repository!=null => input.Name == input.Repository.Path
var prjPath = Path.Combine(WorkingDir, input.Name);
var repoInfo = new DirectoryInfo(prjPath);
var makeStart = CreateStartInfo(prjPath);
var args = string.Join(" ", Args);
var cloneStart = new ProcessStartInfo
( _cmdPath, args )
{
WorkingDirectory = prjPath,
RedirectStandardOutput = true,
UseShellExecute = false
};
// TODO make `.ansi.log` a defined constant.
var logFile = new FileInfo
( Path.Combine
( _repositoryRootPath, $"{input.Name}.ansi.log" ));
var logFile = new FileInfo(Path.Combine(_repositoryRootPath, LogPath));
using (var stream = logFile.Create())
using (var writer = new StreamWriter(stream))
{
var process = Process.Start(cloneStart);
var process = Process.Start(makeStart);
// TODO announce ...
while (!process.HasExited)
{

View File

@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
namespace Yavsc.Server.Models.IT.SourceCode
@ -17,5 +19,18 @@ namespace Yavsc.Server.Models.IT.SourceCode
throw new Exception ($"This directory doesn't exist: {WorkingDir},\nand cannot be used as a repository.");
}
public ProcessStartInfo CreateStartInfo(string workingDir)
{
var args = string.Join(" ", Args);
var info = new ProcessStartInfo
( _cmdPath, args )
{
WorkingDirectory = workingDir ?? WorkingDir,
RedirectStandardOutput = true,
UseShellExecute = false
};
return info;
}
}
}