Browse Source

Fixes for custom args

pull/5/head
Ionite 1 year ago
parent
commit
25800d4750
No known key found for this signature in database
  1. 5
      StabilityMatrix/Models/LaunchOption.cs

5
StabilityMatrix/Models/LaunchOption.cs

@ -62,6 +62,11 @@ public partial class LaunchOption : ObservableObject
return (int?) OptionValue != null ? $"{Name} {OptionValue}" : null; return (int?) OptionValue != null ? $"{Name} {OptionValue}" : null;
case LaunchOptionType.String: case LaunchOptionType.String:
var valueString = (string?) OptionValue; var valueString = (string?) OptionValue;
// Special case empty string name to not do quoting (for custom launch args)
if (Name == "")
{
return valueString;
}
return string.IsNullOrWhiteSpace(valueString) ? null : $"{Name} {ProcessRunner.Quote(valueString)}"; return string.IsNullOrWhiteSpace(valueString) ? null : $"{Name} {ProcessRunner.Quote(valueString)}";
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();

Loading…
Cancel
Save