-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFeatureWriter.cs
30 lines (28 loc) · 1.04 KB
/
FeatureWriter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace tfs_cli
{
class FeatureWriter : TestsWriter
{
public FeatureWriter(string output, ConnectionData con, ITfsCliBuilder builder) : base(output, con, builder){}
protected override void WriteToOutput()
{
string from = ((FeatureBuilder)_builder).GetFeatureFilesPath();
try
{
TfsCliHelper.Debug(string.Format("CopyFeaturesTo: \"{0}\"", _output));
foreach (var file in Directory.GetFiles(from))
File.Copy(file, Path.Combine(_output, Path.GetFileName(file)), true);
Directory.Delete(from, true);
}
catch (IOException e)
{
TfsCliHelper.ExitWithError(string.Format("Could not copy feature files from {0} to {1}.\nError: {2}", from, _output, e.Message.ToString()));
}
}
}
}