Skip to content

Commit

Permalink
Skip confirmation for alias with -alias/-cli flag
Browse files Browse the repository at this point in the history
The user has already specified this is what they want by passing in the
flag, so there is no point in asking again.
  • Loading branch information
tobil4sk authored and joshtynjala committed Jan 31, 2025
1 parent dd9f9d4 commit 69bbcae
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions tools/utils/PlatformSetup.hx
Original file line number Diff line number Diff line change
Expand Up @@ -875,13 +875,16 @@ class PlatformSetup
var installedCommand = false;
var answer = YES;

if (targetFlags.exists("y"))
if (!(targetFlags.exists("alias") || targetFlags.exists("cli")))
{
Sys.println("Do you want to install the \"lime\" command? [y/n/a] y");
}
else
{
answer = CLIHelper.ask("Do you want to install the \"lime\" command?");
if (targetFlags.exists("y"))
{
Sys.println("Do you want to install the \"lime\" command? [y/n/a] y");
}
else
{
answer = CLIHelper.ask("Do you want to install the \"lime\" command?");
}
}

if (answer == YES || answer == ALWAYS)
Expand Down Expand Up @@ -1123,13 +1126,16 @@ class PlatformSetup
var installedCommand = false;
var answer = YES;

if (targetFlags.exists("y"))
if (!(targetFlags.exists("alias") || targetFlags.exists("cli")))
{
Sys.println("Do you want to install the \"openfl\" command? [y/n/a] y");
}
else
{
answer = CLIHelper.ask("Do you want to install the \"openfl\" command?");
if (targetFlags.exists("y"))
{
Sys.println("Do you want to install the \"openfl\" command? [y/n/a] y");
}
else
{
answer = CLIHelper.ask("Do you want to install the \"openfl\" command?");
}
}

if (answer == YES || answer == ALWAYS)
Expand Down

0 comments on commit 69bbcae

Please sign in to comment.