MCPcopy
hub / github.com/vercel/next.js / checkForYarn

Method checkForYarn

packages/next-codemod/transforms/cra-to-next.ts:148–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

146 }
147
148 private checkForYarn() {
149 try {
150 const userAgent = process.env.npm_config_user_agent
151 if (userAgent) {
152 return Boolean(userAgent && userAgent.startsWith('yarn'))
153 }
154 execa.sync('yarnpkg', ['--version'], { stdio: 'ignore' })
155 return true
156 } catch (e) {
157 console.log('error', e)
158 return false
159 }
160 }
161
162 private logCreate(...args: any[]) {
163 if (this.shouldLogInfo) {

Callers 1

constructorMethod · 0.95

Calls 2

startsWithMethod · 0.80
logMethod · 0.45

Tested by

no test coverage detected