@@ -65,13 +65,16 @@ export const throwIfInvalid = ({
65
65
66
66
// We expected it to be the toolbelt version but it is using the new tracking files
67
67
if ( toValidate === 'toolbelt' ) {
68
+ // some of the toolbelt commands aren't using SfdxCommand and the SfdxError actions won't be automatically displayed
68
69
throw new SfdxError (
69
- messages . getMessage ( 'sourceTrackingFileVersionMismatch' , [ 'new' ] ) ,
70
- 'SourceTrackingFileVersionMismatch' ,
71
- [
72
- messages . getMessage ( 'useOtherVersion' , [ 'new' , replaceRenamedCommands ( command ) ] ) ,
73
- messages . getMessage ( 'clearSuggestion' , [ 'new' , replaceRenamedCommands ( 'sfdx force:source:tracking:clear' ) ] ) ,
74
- ]
70
+ `${ messages . getMessage ( 'sourceTrackingFileVersionMismatch' , [ 'new' ] ) } \n\nTry this:\n${ messages . getMessage (
71
+ 'useOtherVersion' ,
72
+ [ 'new' , replaceRenamedCommands ( command , true ) ]
73
+ ) } .\n${ messages . getMessage ( 'clearSuggestion' , [
74
+ 'new' ,
75
+ replaceRenamedCommands ( 'sfdx force:source:tracking:clear' , true ) ,
76
+ ] ) } .`,
77
+ 'SourceTrackingFileVersionMismatch'
75
78
) ;
76
79
}
77
80
// We expected it to be the plugin-source version but it is using the old tracking files
@@ -80,8 +83,8 @@ export const throwIfInvalid = ({
80
83
messages . getMessage ( 'sourceTrackingFileVersionMismatch' , [ 'old' ] ) ,
81
84
'SourceTrackingFileVersionMismatch' ,
82
85
[
83
- messages . getMessage ( 'useOtherVersion' , [ 'old' , replaceRenamedCommands ( command , true ) ] ) ,
84
- messages . getMessage ( 'clearSuggestion' , [ 'old' , 'sfdx force:source:tracking:clear' ] ) ,
86
+ messages . getMessage ( 'useOtherVersion' , [ 'old' , replaceRenamedCommands ( command ) ] ) ,
87
+ messages . getMessage ( 'clearSuggestion' , [ 'old' , replaceRenamedCommands ( 'sfdx force:source:tracking:clear' ) ] ) ,
85
88
]
86
89
) ;
87
90
}
@@ -101,9 +104,9 @@ export const replaceRenamedCommands = (input: string, reverse = false): string =
101
104
} ;
102
105
103
106
const renames = new Map ( [
104
- [ 'force:source:status' , 'force:source:beta :status' ] ,
105
- [ 'force:source:push' , 'force:source:beta :push' ] ,
106
- [ 'force:source:pull' , 'force:source:beta :pull' ] ,
107
- [ 'force:source:tracking:reset' , 'force:source:beta :tracking:reset' ] ,
108
- [ 'force:source:tracking:clear' , 'force:source:beta :tracking:clear' ] ,
107
+ [ 'force:source:status' , 'force:source:legacy :status' ] ,
108
+ [ 'force:source:push' , 'force:source:legacy :push' ] ,
109
+ [ 'force:source:pull' , 'force:source:legacy :pull' ] ,
110
+ [ 'force:source:tracking:reset' , 'force:source:legacy :tracking:reset' ] ,
111
+ [ 'force:source:tracking:clear' , 'force:source:legacy :tracking:clear' ] ,
109
112
] ) ;
0 commit comments