Skip to content

Commit 0327ec2

Browse files
committed
🐛 Fix script completion didn't take input word
1 parent 22aea4a commit 0327ec2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/lib/Get-2ndCompletions.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function Get-2ndCompletions([string] $WordToComplete, [string] $Command) {
1414

1515
# Command's values
1616
if ($commandValues[$Command]) {
17-
$completions += Invoke-Command -ScriptBlock $commandValues[$Command] | ForEach-Object {
17+
$completions += Invoke-Command -ScriptBlock $commandValues[$Command] -ArgumentList @($WordToComplete) | ForEach-Object {
1818
[System.Management.Automation.CompletionResult]::new($_, $_, 'DynamicKeyword', $_)
1919
}
2020
}

src/values/run.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ if (-not $commandValues) {
55
}
66

77
$commandValues['run'] = {
8-
$scriptNames = Get-PackageScripts
8+
param ([string] $WordToComplete)
9+
10+
$scriptNames = Get-PackageScripts | Where-Object {
11+
$_ -like "$WordToComplete*"
12+
}
913

1014
return $scriptNames
1115
}

0 commit comments

Comments
 (0)