Compare commits

...

2 Commits

2 changed files with 12 additions and 3 deletions

@ -176,13 +176,16 @@ namespace isn
} }
}; };
var setapikey = new Command("store-api-key", "Store this API key") var setapikey = new Command("store-api-key", "Store this API key")
{ {
Run = sargs => StoreApiKey(sargs) Run = sargs => StoreApiKey(sargs)
}; };
setapikey.Options = pushoptions;
commandSet.Add(pushCmd);
commandSet.Add(setapikey); commandSet.Add(setapikey);
commandSet.Add(pushCmd);
commandSet.Add(srcCmd); commandSet.Add(srcCmd);
commandSet.Add(showCommand); commandSet.Add(showCommand);
@ -214,6 +217,8 @@ namespace isn
Console.WriteLine("isn version " + GitVersionInformation.AssemblySemFileVer); Console.WriteLine("isn version " + GitVersionInformation.AssemblySemFileVer);
} }
return commandSet.Run(args); return commandSet.Run(args);
} }

@ -1,6 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq; using System.Linq;
using Newtonsoft.Json;
namespace isn namespace isn
{ {
@ -64,13 +66,15 @@ namespace isn
string currentSourceKey; string currentSourceKey;
[JsonIgnore, NotMapped]
public string CurrentSourceKey public string CurrentSourceKey
{ {
get { get {
return currentSourceKey; return currentSourceKey;
} }
set{ set{
if (!Sources.ContainsKey(value)) throw new InvalidOperationException($"source is invalid ({value})"); if (!Sources.ContainsKey(value))
throw new InvalidOperationException($"source is invalid ({value})");
currentSourceKey = value; currentSourceKey = value;
} }
} }

Loading…