@@ -16,9 +16,15 @@ export const umiConfig = async ({
1616 try {
1717 const { binPath } = parse ( root ) ;
1818 const result = execSync ( `${ binPath } config list` , { cwd : root } ) ;
19- return { success : true , data : result . toString ( ) } ;
19+ return {
20+ type : 'text' ,
21+ text : result . toString ( )
22+ } ;
2023 } catch ( error : any ) {
21- return { success : false , data : error . message || 'Failed to list config' } ;
24+ return {
25+ type : 'text' ,
26+ text : error . message || 'Failed to list config'
27+ } ;
2228 }
2329 } ,
2430 } ) ;
@@ -33,9 +39,15 @@ export const umiConfig = async ({
3339 try {
3440 const { binPath } = parse ( root ) ;
3541 const result = execSync ( `${ binPath } config get ${ key } ` , { cwd : root } ) ;
36- return { success : true , data : result . toString ( ) } ;
42+ return {
43+ type : 'text' ,
44+ text : result . toString ( )
45+ } ;
3746 } catch ( error : any ) {
38- return { success : false , data : error . message || `Failed to get config key ${ key } ` } ;
47+ return {
48+ type : 'text' ,
49+ text : error . message || `Failed to get config key ${ key } `
50+ } ;
3951 }
4052 } ,
4153 } ) ;
@@ -53,9 +65,15 @@ export const umiConfig = async ({
5365 const result = execSync ( `${ binPath } config set ${ key } ${ value } ` , {
5466 cwd : root ,
5567 } ) ;
56- return { success : true , data : result . toString ( ) } ;
68+ return {
69+ type : 'text' ,
70+ text : result . toString ( )
71+ } ;
5772 } catch ( error : any ) {
58- return { success : false , data : error . message || `Failed to set config key ${ key } ` } ;
73+ return {
74+ type : 'text' ,
75+ text : error . message || `Failed to set config key ${ key } `
76+ } ;
5977 }
6078 } ,
6179 } ) ;
@@ -72,9 +90,15 @@ export const umiConfig = async ({
7290 const result = execSync ( `${ binPath } config remove ${ key } ` , {
7391 cwd : root ,
7492 } ) ;
75- return { success : true , data : result . toString ( ) } ;
93+ return {
94+ type : 'text' ,
95+ text : result . toString ( )
96+ } ;
7697 } catch ( error : any ) {
77- return { success : false , data : error . message || `Failed to remove config key ${ key } ` } ;
98+ return {
99+ type : 'text' ,
100+ text : error . message || `Failed to remove config key ${ key } `
101+ } ;
78102 }
79103 } ,
80104 } ) ;
0 commit comments