Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Files.App/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
using Microsoft.UI.Windowing;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media.Animation;
using System.IO;
using System.Runtime.InteropServices;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Storage;
using IO = System.IO;
Expand Down Expand Up @@ -63,7 +65,8 @@ public async Task InitializeApplicationAsync(object activatedEventArgs)
case ILaunchActivatedEventArgs launchArgs:
if (launchArgs.Arguments is not null &&
(CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files-dev.exe", StringComparison.OrdinalIgnoreCase)
|| CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files-dev", StringComparison.OrdinalIgnoreCase)))
|| CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files-dev", StringComparison.OrdinalIgnoreCase)
|| CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].Equals(Path.Join(Package.Current.InstalledLocation.Path, "Files.App", "Files.exe"), StringComparison.OrdinalIgnoreCase)))
{
// WINUI3: When launching from commandline the argument is not ICommandLineActivatedEventArgs (#10370)
var ppm = CommandLineParser.ParseUntrustedCommands(launchArgs.Arguments);
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Utils/CommandLine/CommandLineParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public sealed class CommandLineParser
/// <returns>A collection of parsed command.</returns>
public static ParsedCommands ParseUntrustedCommands(string cmdLineString)
{
var parsedArgs = Parse(SplitArguments(cmdLineString, true));
var parsedArgs = Parse(SplitArguments(cmdLineString.TrimEnd(), true));

return ParseSplitArguments(parsedArgs);
}
Expand Down
Loading