Skip to content

Commit 9a8455b

Browse files
committed
some update
1 parent 324e80e commit 9a8455b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Utils/Interact.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,16 @@ public static function choice($description, $options, $default = null, $allowExi
9696
$options['q'] = 'quit';
9797
}
9898

99-
beginChoice:
100-
$text = " <comment>$description</comment>";
99+
$text = "<comment>$description</comment>";
101100
foreach ($options as $key => $value) {
102101
$text .= "\n <info>$key</info>) $value";
103102
}
104103

105104
$defaultText = $default ? "[default:<comment>{$default}</comment>]" : '';
106-
$r = self::read($text . "\n You choice{$defaultText} : ");
105+
self::write($text);
106+
107+
beginChoice:
108+
$r = self::read("Your choice{$defaultText} : ");
107109

108110
// error, allow try again once.
109111
if (!array_key_exists($r, $options)) {
@@ -393,7 +395,7 @@ public static function promptSilent(string $prompt = 'Enter Password:')
393395

394396
// at windows cmd.
395397
if (Helper::isWindows()) {
396-
$vbScript = sys_get_temp_dir() . 'prompt_password.vbs';
398+
$vbScript = CliUtil::getTempDir() . '/hidden_prompt_input.vbs';
397399

398400
file_put_contents($vbScript, 'wscript.echo(InputBox("' . $prompt . '", "", "password here"))');
399401

0 commit comments

Comments
 (0)