diff --git a/clio.sln b/clio.sln index e07f1449..68315083 100644 --- a/clio.sln +++ b/clio.sln @@ -34,13 +34,9 @@ Global {718FE94B-0CB7-4977-B2D7-E661C8E57555}.Release|Any CPU.ActiveCfg = Release|Any CPU {718FE94B-0CB7-4977-B2D7-E661C8E57555}.Release|Any CPU.Build.0 = Release|Any CPU {E24226F9-C177-458F-AF34-9338E2699983}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E24226F9-C177-458F-AF34-9338E2699983}.Debug|Any CPU.Build.0 = Debug|Any CPU {E24226F9-C177-458F-AF34-9338E2699983}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E24226F9-C177-458F-AF34-9338E2699983}.Release|Any CPU.Build.0 = Release|Any CPU {9DDD1340-FA52-4402-BF10-11C46BA9F7A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9DDD1340-FA52-4402-BF10-11C46BA9F7A0}.Debug|Any CPU.Build.0 = Debug|Any CPU {9DDD1340-FA52-4402-BF10-11C46BA9F7A0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9DDD1340-FA52-4402-BF10-11C46BA9F7A0}.Release|Any CPU.Build.0 = Release|Any CPU {DD970BB9-CAD2-4C63-9017-91C6859B39EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DD970BB9-CAD2-4C63-9017-91C6859B39EA}.Debug|Any CPU.Build.0 = Debug|Any CPU {DD970BB9-CAD2-4C63-9017-91C6859B39EA}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/clio/Command/OpenAppCommand.cs b/clio/Command/OpenAppCommand.cs index 803b65e8..0eab32c9 100644 --- a/clio/Command/OpenAppCommand.cs +++ b/clio/Command/OpenAppCommand.cs @@ -24,6 +24,19 @@ public override int Execute(OpenAppOptions options) { try { var settings = new SettingsRepository(); var env = settings.GetEnvironment(options); + + if(string.IsNullOrEmpty(env.Uri)) { + Logger.WriteError($"Environment:{options.Environment ?? ""} has empty url. Use 'clio reg-web-app' command to configure it."); + return 1; + } + + if(!Uri.TryCreate(env.Uri, UriKind.Absolute, out Uri _)) { + Logger.WriteError($"Environment:{options.Environment ?? ""} has incorrect url format. Actual Url: '{env.Uri}' " + + $"Use \r\n\r\n\tclio cfg -e {options.Environment} -u \r\n\r\n command to configure it."); + return 1; + } + + WebBrowser.OpenUrl(env.SimpleloginUri); return 0; } catch (Exception e) { diff --git a/clio/Environment/ConfigurationOptions.cs b/clio/Environment/ConfigurationOptions.cs index 0e7c0b03..44b1b706 100644 --- a/clio/Environment/ConfigurationOptions.cs +++ b/clio/Environment/ConfigurationOptions.cs @@ -84,8 +84,12 @@ public string AuthAppUri { } [YamlIgnore] + [Newtonsoft.Json.JsonIgnore] public string SimpleloginUri { get { + if(Uri == null) { + return ""; + } var cleanUri = Uri; if (!string.IsNullOrEmpty(cleanUri)) { var domain = ".creatio.com";