File tree Expand file tree Collapse file tree
packages/opencode/src/npm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,13 +150,17 @@ export const layer = Layer.effect(
150150 if ( ! canWrite ) return
151151
152152 const add = input ?. add . map ( ( pkg ) => [ pkg . name , pkg . version ] . filter ( Boolean ) . join ( "@" ) ) ?? [ ]
153- yield * Effect . gen ( function * ( ) {
154- const nodeModulesExists = yield * afs . existsSafe ( path . join ( dir , "node_modules" ) )
155- if ( ! nodeModulesExists ) {
156- yield * reify ( { add, dir } )
157- return
158- }
159- } ) . pipe ( Effect . withSpan ( "Npm.checkNodeModules" ) )
153+ if (
154+ yield * Effect . gen ( function * ( ) {
155+ const nodeModulesExists = yield * afs . existsSafe ( path . join ( dir , "node_modules" ) )
156+ if ( ! nodeModulesExists ) {
157+ yield * reify ( { add, dir } )
158+ return true
159+ }
160+ return false
161+ } ) . pipe ( Effect . withSpan ( "Npm.checkNodeModules" ) )
162+ )
163+ return
160164
161165 yield * Effect . gen ( function * ( ) {
162166 const pkg = yield * afs . readJson ( path . join ( dir , "package.json" ) ) . pipe ( Effect . orElseSucceed ( ( ) => ( { } ) ) )
You can’t perform that action at this time.
0 commit comments