forked from scriptcs/scriptcs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSaveCommand.cs
More file actions
29 lines (26 loc) · 831 Bytes
/
SaveCommand.cs
File metadata and controls
29 lines (26 loc) · 831 Bytes
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
using System;
namespace ScriptCs.Command
{
internal class SaveCommand : ISaveCommand
{
private readonly IPackageAssemblyResolver _packageAssemblyResolver;
public SaveCommand(IPackageAssemblyResolver packageAssemblyResolver)
{
_packageAssemblyResolver = packageAssemblyResolver;
}
public CommandResult Execute()
{
Console.WriteLine("Initiated saving packages into packages.config...");
try
{
_packageAssemblyResolver.SavePackages(msg => Console.WriteLine(msg));
}
catch (Exception e)
{
Console.WriteLine("Save failed: {0}.", e.Message);
return CommandResult.Error;
}
return CommandResult.Success;
}
}
}