|
|
@ -10,8 +10,6 @@ namespace isn
|
|
|
|
public partial class Program
|
|
|
|
public partial class Program
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
public static IEnumerable<IsnSourceSettings> Sources { get; protected set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void LoadConfig()
|
|
|
|
public static void LoadConfig()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FileInfo cfgSettingIf = new FileInfo(_configFileName);
|
|
|
|
FileInfo cfgSettingIf = new FileInfo(_configFileName);
|
|
|
@ -19,11 +17,11 @@ namespace isn
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var json = File.ReadAllText(cfgSettingIf.FullName);
|
|
|
|
var json = File.ReadAllText(cfgSettingIf.FullName);
|
|
|
|
settings = JsonConvert.DeserializeObject<Settings>(json);
|
|
|
|
settings = JsonConvert.DeserializeObject<Settings>(json);
|
|
|
|
source = settings.DefaultSource;
|
|
|
|
currentSource = settings.DefaultSource;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static OptionSet storeoptions = new OptionSet {
|
|
|
|
static OptionSet storeoptions = new OptionSet {
|
|
|
|
{ "s|source=", "use source", val => source = source ?? val },
|
|
|
|
{ "s|source=", "use source", val => currentSource = currentSource ?? val },
|
|
|
|
{ "h|help", "show this message and exit", h => shouldShowPushHelp = h != null },
|
|
|
|
{ "h|help", "show this message and exit", h => shouldShowPushHelp = h != null },
|
|
|
|
};
|
|
|
|
};
|
|
|
|
private static string _configFileName =
|
|
|
|
private static string _configFileName =
|
|
|
@ -41,7 +39,7 @@ namespace isn
|
|
|
|
static OptionSet pushoptions = new OptionSet {
|
|
|
|
static OptionSet pushoptions = new OptionSet {
|
|
|
|
{ "k|api-key=", "use api key", val => apiKey = apiKey ?? val },
|
|
|
|
{ "k|api-key=", "use api key", val => apiKey = apiKey ?? val },
|
|
|
|
{ "p|store-api-key", "store used api key (=<true|false>)", val => storApiKey = val != null },
|
|
|
|
{ "p|store-api-key", "store used api key (=<true|false>)", val => storApiKey = val != null },
|
|
|
|
{ "s|source=", "use source", val => source = source ?? val },
|
|
|
|
{ "s|source=", "use source", val => currentSource = currentSource ?? val },
|
|
|
|
{ "h|help", "show this message and exit", h => shouldShowPushHelp = h != null },
|
|
|
|
{ "h|help", "show this message and exit", h => shouldShowPushHelp = h != null },
|
|
|
|
};
|
|
|
|
};
|
|
|
|
static OptionSet sourceoptions = new OptionSet {
|
|
|
|
static OptionSet sourceoptions = new OptionSet {
|
|
|
@ -56,7 +54,7 @@ namespace isn
|
|
|
|
private static bool shouldShowSourceHelp;
|
|
|
|
private static bool shouldShowSourceHelp;
|
|
|
|
private static bool shouldShowPushHelp;
|
|
|
|
private static bool shouldShowPushHelp;
|
|
|
|
private static string apiKey = null;
|
|
|
|
private static string apiKey = null;
|
|
|
|
private static string source = null;
|
|
|
|
private static string currentSource = null;
|
|
|
|
private static int pushKO = 0;
|
|
|
|
private static int pushKO = 0;
|
|
|
|
private static bool storApiKey = false;
|
|
|
|
private static bool storApiKey = false;
|
|
|
|
public static IDataProtector Protector { get; set; } = new DefaultDataProtector();
|
|
|
|
public static IDataProtector Protector { get; set; } = new DefaultDataProtector();
|
|
|
@ -166,7 +164,7 @@ namespace isn
|
|
|
|
pushoptions.WriteOptionDescriptions(Console.Out);
|
|
|
|
pushoptions.WriteOptionDescriptions(Console.Out);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<PushReport> reports = await PushPkgAsync(pargs);
|
|
|
|
List<PushReport> reports = PushPkg(pargs);
|
|
|
|
Console.WriteLine(JsonConvert.SerializeObject(reports));
|
|
|
|
Console.WriteLine(JsonConvert.SerializeObject(reports));
|
|
|
|
pushKO = reports.Count(r => !r.OK && !r.AlreadyPresent);
|
|
|
|
pushKO = reports.Count(r => !r.OK && !r.AlreadyPresent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|