-
Notifications
You must be signed in to change notification settings - Fork 3
/
Program.cs
43 lines (36 loc) · 1.01 KB
/
Program.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
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) 2015 Abel Cheng <abelcys@gmail.com>. Licensed under the MIT license.
// Repository: https://nupkgmerge.codeplex.com/
using System;
namespace NuGetPackageMerge
{
class Program
{
static int Main(string[] args)
{
CmdArguments cmdArguments = new CmdArguments();
try
{
if (cmdArguments.Parse(args))
{
NupkgMerge nupkgMerge = new NupkgMerge(cmdArguments.PrimaryNupkg);
nupkgMerge.Merge(cmdArguments.SecondNupkg);
nupkgMerge.Save(cmdArguments.OutputNupkg);
Console.WriteLine("Successfully merged '{0}' with '{1}' into '{2}'.",
cmdArguments.PrimaryNupkg, cmdArguments.SecondNupkg, cmdArguments.OutputNupkg);
return 0;
}
else
return 1;
}
catch (Exception e)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.Error.WriteLine(e.Message ?? "Failed!");
if (e.InnerException != null && e.InnerException.Message != null)
Console.Error.WriteLine(e.InnerException.Message);
Console.ResetColor();
return -1;
}
}
}
}