This repository was archived by the owner on Jul 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed
plugins/plugin-core-support/up/src Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export type CheckerArgs<O extends ParsedOptions = ParsedOptions> = Pick<
26
26
>
27
27
28
28
export type CheckResultSuccess = true | string
29
- export type CheckResult = CheckResultSuccess | false
29
+ export type CheckResult = CheckResultSuccess | { ok : boolean ; message : string } | false
30
30
31
31
export type Stdout = NodeJS . WriteStream & NodeJS . WritableStream
32
32
Original file line number Diff line number Diff line change @@ -28,7 +28,16 @@ async function check(args: Arguments) {
28
28
Object . assign ( { } , args , { command : 'ibmcloud plugin show code-engine --output json' } )
29
29
)
30
30
)
31
- return `v${ Version . Major } .${ Version . Minor } .${ Version . Build } `
31
+
32
+ const version = `v${ Version . Major } .${ Version . Minor } .${ Version . Build } `
33
+ if ( Version . Major < 1 || Version . Minor < 6 ) {
34
+ return {
35
+ ok : false ,
36
+ message : `Your IBM Cloud CodeEngine CLI plugin is too old. Got ${ version } . Expected >= 1.6.0`
37
+ }
38
+ } else {
39
+ return version
40
+ }
32
41
} catch ( err ) {
33
42
return false
34
43
}
Original file line number Diff line number Diff line change @@ -53,10 +53,12 @@ type Status = { ok: boolean; message: string }
53
53
54
54
async function toStatus ( checker : Checker , checkResultP : ReturnType < Checker [ 'check' ] > ) : Promise < Status > {
55
55
const checkResult = await checkResultP
56
- return {
57
- ok : typeof checkResult === 'string' || checkResult === true ,
58
- message : formatLabel ( checker , checkResult )
59
- }
56
+ return typeof checkResult === 'object'
57
+ ? checkResult
58
+ : {
59
+ ok : typeof checkResult === 'string' || checkResult === true ,
60
+ message : formatLabel ( checker , checkResult )
61
+ }
60
62
}
61
63
62
64
export default async function doCheck < T extends CheckResult > (
@@ -127,7 +129,7 @@ function listrTaskForChecker(
127
129
}
128
130
} )
129
131
. catch ( err => {
130
- ctx [ idx ] = { ok : false }
132
+ ctx [ idx ] = { ok : false , message : err . message }
131
133
obs . error ( err )
132
134
} )
133
135
. finally ( ( ) => obs . complete ( ) )
You can’t perform that action at this time.
0 commit comments