Skip to content

Commit

Permalink
Refactor PromptForPortableAliasIfApplicable method
Browse files Browse the repository at this point in the history
  • Loading branch information
mdanish-kh committed May 15, 2023
1 parent 66e8e70 commit b6bb8db
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/WingetCreateCLI/Commands/NewCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -457,21 +457,18 @@ private static void PromptForPortableAliasIfApplicable(Installer installer)

if (!string.IsNullOrEmpty(portableCommandAlias))
{
List<string> portableCommands = new List<string> { portableCommandAlias };
List<string> portableCommands = new List<string> { portableCommandAlias.Trim() };
installer.Commands = portableCommands;
}
}

if (installer.NestedInstallerType == NestedInstallerType.Portable)
{
foreach (NestedInstallerFile nestedInstallerFile in installer.NestedInstallerFiles)
{
string portableCommandAlias = Prompt.Input<string>(Resources.PortableCommandAlias_Message);
string portableCommandAlias = Prompt.Input<string>(Resources.PortableCommandAlias_Message);

if (!string.IsNullOrEmpty(portableCommandAlias))
{
nestedInstallerFile.PortableCommandAlias = portableCommandAlias;
}
if (!string.IsNullOrEmpty(portableCommandAlias))
{
installer.NestedInstallerFiles.First().PortableCommandAlias = portableCommandAlias.Trim();
}
}
}
Expand Down

0 comments on commit b6bb8db

Please sign in to comment.