@@ -110,25 +110,22 @@ export const layer = Layer.effect(
110110 const flock = yield * EffectFlock . Service
111111 const spawner = yield * ChildProcessSpawner . ChildProcessSpawner
112112 const directory = ( pkg : string ) => path . join ( global . cache , "packages" , sanitize ( pkg ) )
113- const runView = Effect . fnUntraced (
114- function * ( cmd : string [ ] ) {
115- const handle = yield * spawner . spawn (
116- ChildProcess . make ( cmd [ 0 ] , cmd . slice ( 1 ) , {
117- extendEnv : true ,
118- } ) ,
119- )
120- const [ stdout , stderr ] = yield * Effect . all (
121- [ Stream . mkString ( Stream . decodeText ( handle . stdout ) ) , Stream . mkString ( Stream . decodeText ( handle . stderr ) ) ] ,
122- { concurrency : 2 } ,
123- )
124- const code = yield * handle . exitCode
125- if ( code !== 0 || ! stdout . trim ( ) ) {
126- return yield * Effect . fail ( stderr || stdout || `Failed to run ${ cmd . join ( " " ) } ` )
127- }
128- return yield * Schema . decodeUnknownEffect ( Schema . fromJsonString ( Schema . String ) ) ( stdout )
129- } ,
130- Effect . scoped ,
131- )
113+ const runView = Effect . fnUntraced ( function * ( cmd : string [ ] ) {
114+ const handle = yield * spawner . spawn (
115+ ChildProcess . make ( cmd [ 0 ] , cmd . slice ( 1 ) , {
116+ extendEnv : true ,
117+ } ) ,
118+ )
119+ const [ stdout , stderr ] = yield * Effect . all (
120+ [ Stream . mkString ( Stream . decodeText ( handle . stdout ) ) , Stream . mkString ( Stream . decodeText ( handle . stderr ) ) ] ,
121+ { concurrency : 2 } ,
122+ )
123+ const code = yield * handle . exitCode
124+ if ( code !== 0 || ! stdout . trim ( ) ) {
125+ return yield * Effect . fail ( stderr || stdout || `Failed to run ${ cmd . join ( " " ) } ` )
126+ }
127+ return yield * Schema . decodeUnknownEffect ( Schema . fromJsonString ( Schema . String ) ) ( stdout )
128+ } , Effect . scoped )
132129 const viewLatestVersion = Effect . fnUntraced ( function * ( pkg : string ) {
133130 return yield * runView ( [ "npm" , "view" , pkg , "dist-tags.latest" , "--json" ] ) . pipe (
134131 Effect . catch ( ( ) =>
0 commit comments