|
5 | 5 | using System.Linq;
|
6 | 6 | using System.Net;
|
7 | 7 | using System.Net.Http;
|
| 8 | +using System.Runtime.InteropServices; |
8 | 9 | using System.Security.Cryptography.X509Certificates;
|
9 | 10 | using System.Threading.Tasks;
|
10 | 11 | using Azure.Functions.Cli.Actions.HostActions.WebHost.Security;
|
@@ -54,15 +55,30 @@ internal class StartHostAction : BaseAction
|
54 | 55 |
|
55 | 56 | public DebuggerType Debugger { get; set; }
|
56 | 57 |
|
57 |
| - public IDictionary<string, string> IConfigurationArguments { get; set; } = new Dictionary<string, string>() |
58 |
| - { |
59 |
| - ["workers:node:debug"] = Constants.NodeDebugPort.ToString(), |
60 |
| - ["workers:java:debug"] = Constants.JavaDebugPort.ToString(), |
61 |
| - }; |
| 58 | + public IDictionary<string, string> IConfigurationArguments { get; set; } |
62 | 59 |
|
63 | 60 | public StartHostAction(ISecretsManager secretsManager)
|
64 | 61 | {
|
65 | 62 | this._secretsManager = secretsManager;
|
| 63 | + IConfigurationArguments = InitializeConfigurationArguments(); |
| 64 | + } |
| 65 | + |
| 66 | + private IDictionary<string, string> InitializeConfigurationArguments() |
| 67 | + { |
| 68 | + string nodeDebugKey = "workers:node:Debug"; |
| 69 | + string javaDebugKey = "workers:java:Debug"; |
| 70 | + |
| 71 | + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) |
| 72 | + { |
| 73 | + nodeDebugKey = nodeDebugKey.Replace(":", "__"); |
| 74 | + javaDebugKey = javaDebugKey.Replace(":", "__"); |
| 75 | + } |
| 76 | + |
| 77 | + return new Dictionary<string, string>() |
| 78 | + { |
| 79 | + [nodeDebugKey] = Constants.NodeDebugPort.ToString(), |
| 80 | + [javaDebugKey] = Constants.JavaDebugPort.ToString(), |
| 81 | + }; |
66 | 82 | }
|
67 | 83 |
|
68 | 84 | public override ICommandLineParserResult ParseArgs(string[] args)
|
|
0 commit comments