@@ -3,6 +3,8 @@ package task
33import (
44 "slices"
55
6+ "github.com/elliotchance/orderedmap/v3"
7+
68 "github.com/go-task/task/v3/errors"
79 "github.com/go-task/task/v3/internal/input"
810 "github.com/go-task/task/v3/internal/term"
@@ -32,7 +34,7 @@ func (e *Executor) promptDepsVars(calls []*Call) error {
3234
3335 // Collect all missing vars from the dependency tree
3436 visited := make (map [string ]bool )
35- varsMap := make ( map [string ] * ast.VarsWithValidation )
37+ varsMap := orderedmap . NewOrderedMap [string , * ast.VarsWithValidation ]( )
3638
3739 var collect func (call * Call ) error
3840 collect = func (call * Call ) error {
@@ -42,8 +44,8 @@ func (e *Executor) promptDepsVars(calls []*Call) error {
4244 }
4345
4446 for _ , v := range getMissingRequiredVars (compiledTask ) {
45- if _ , exists := varsMap [ v .Name ]; ! exists {
46- varsMap [ v .Name ] = v
47+ if ! varsMap . Has ( v .Name ) {
48+ varsMap . Set ( v .Name , v )
4749 }
4850 }
4951
@@ -73,14 +75,14 @@ func (e *Executor) promptDepsVars(calls []*Call) error {
7375 }
7476 }
7577
76- if len ( varsMap ) == 0 {
78+ if varsMap . Len ( ) == 0 {
7779 return nil
7880 }
7981
8082 prompter := e .newPrompter ()
8183 e .promptedVars = ast .NewVars ()
8284
83- for _ , v := range varsMap {
85+ for v := range varsMap . Values () {
8486 value , err := prompter .Prompt (v .Name , getEnumValues (v .Enum ))
8587 if err != nil {
8688 if errors .Is (err , input .ErrCancelled ) {
0 commit comments