Browse Source
Create sync version of `GetSuitePort` method
pull/17050/head
Berkan Sasmaz
3 years ago
No known key found for this signature in database
GPG Key ID: 4E387A3A3BCC339B
1 changed files with
28 additions and
0 deletions
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Services/SuiteAppSettingsService.cs
|
|
|
@ -46,6 +46,34 @@ public class SuiteAppSettingsService : ITransientDependency |
|
|
|
|
|
|
|
return Convert.ToInt32(url.Split(":").Last()); |
|
|
|
} |
|
|
|
|
|
|
|
public int GetSuitePort() |
|
|
|
{ |
|
|
|
return GetSuitePort(GetCurrentSuiteVersion()); |
|
|
|
} |
|
|
|
|
|
|
|
public int GetSuitePort(string version) |
|
|
|
{ |
|
|
|
var filePath = GetFilePathOrNull(version); |
|
|
|
|
|
|
|
if (filePath == null) |
|
|
|
{ |
|
|
|
return DefaultPort; |
|
|
|
} |
|
|
|
|
|
|
|
var content = File.ReadAllText(filePath); |
|
|
|
|
|
|
|
var contentAsJson = JObject.Parse(content); |
|
|
|
|
|
|
|
var url = contentAsJson["AbpSuite"]?["ApplicationUrl"]?.ToString(); |
|
|
|
|
|
|
|
if (url == null) |
|
|
|
{ |
|
|
|
return DefaultPort; |
|
|
|
} |
|
|
|
|
|
|
|
return Convert.ToInt32(url.Split(":").Last()); |
|
|
|
} |
|
|
|
|
|
|
|
private string GetFilePathOrNull(string version) |
|
|
|
{ |
|
|
|
|