MCPcopy
hub / github.com/desktop/desktop / resolveVersionInNpmRcFile

Function resolveVersionInNpmRcFile

script/validate-electron-version.ts:72–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70}
71
72function resolveVersionInNpmRcFile() {
73 const root = dirname(__dirname)
74 const path = join(root, 'app', '.npmrc')
75 const text = readFileSync(path, 'utf-8')
76 const version = text.match(/\d+.\d+.\d+/)
77 if (!version) {
78 handleError(
79 `No target version found in the app/.npmrc file. Is this still needed?`
80 )
81 }
82
83 return version[0]
84}

Callers 1

Calls 1

handleErrorFunction · 0.70

Tested by

no test coverage detected