File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -110,17 +110,22 @@ export const runAutoFixes = async () => {
110
110
return errors ;
111
111
} ;
112
112
113
- export const getWorkspaces = async ( filter ?: ( workspace : SlugLessWorkspace ) => boolean ) => {
113
+ export const getWorkspaces = async (
114
+ filter ?: ( workspace : SlugLessWorkspace ) => boolean ,
115
+ ) : Promise < Workspace [ ] > => {
114
116
const { stdout : rawWorkspaces } = await execute ( 'yarn' , [ 'workspaces' , 'list' , '--json' ] ) ;
115
117
// Replace new lines with commas to make it JSON valid.
116
118
const jsonString = `[${ rawWorkspaces . replace ( / \n ( [ ^ \] ] ) / g, ',\n$1' ) } ]` ;
117
119
const workspacesArray = JSON . parse ( jsonString ) as SlugLessWorkspace [ ] ;
118
120
return workspacesArray
119
121
. filter ( ( workspace : SlugLessWorkspace ) => ( filter ? filter ( workspace ) : true ) )
120
- . map ( ( workspace : SlugLessWorkspace ) => ( {
121
- ...workspace ,
122
- slug : workspace . location . split ( '/' ) . pop ( ) as string ,
123
- } ) ) ;
122
+ . map ( ( workspace : SlugLessWorkspace ) => {
123
+ const plugin : Workspace = {
124
+ ...workspace ,
125
+ slug : workspace . location . split ( '/' ) . pop ( ) as string ,
126
+ } ;
127
+ return plugin ;
128
+ } ) ;
124
129
} ;
125
130
126
131
// TODO: Update this, it's a bit hacky.
You can’t perform that action at this time.
0 commit comments