JezK
Edit File: yarn-version.js.map
{"version":3,"file":"yarn-version.js","names":["require","version","originalInstallationMethod","installationMethod","getInstallationMethod","manifestPath","path","join","__dirname","fs","existsSync","readJson","manifest"],"sourceRoot":"../../src","sources":["util/yarn-version.js"],"sourcesContent":["/**\n * Determines the current version of Yarn itself.\n * @flow\n */\n\nimport {readJson} from './fs';\n\nimport fs from 'fs';\nimport path from 'path';\n\n// This will be bundled directly in the .js file for production builds\nconst {version, installationMethod: originalInstallationMethod} = require('../../package.json');\nexport {version};\n\nexport async function getInstallationMethod(): Promise<InstallationMethod> {\n let installationMethod = originalInstallationMethod;\n\n // If there's a package.json in the parent directory, it could have an\n // override for the installation method, so we should prefer that over\n // whatever was originally in Yarn's package.json. This is the case with\n // systems such as Homebrew, which take the tarball and modify the\n // installation method so we're aware of the fact that Yarn was installed via\n // Homebrew (so things like update notifications can point out the correct\n // command to upgrade).\n try {\n const manifestPath = path.join(__dirname, '..', 'package.json');\n if (fs.existsSync(manifestPath)) {\n // non-async version is deprecated\n const manifest = await readJson(manifestPath);\n if (manifest.installationMethod) {\n installationMethod = manifest.installationMethod;\n }\n }\n } catch (e) {\n // Ignore any errors; this is not critical functionality.\n }\n return installationMethod;\n}\n\nexport type InstallationMethod =\n | 'tar'\n | 'homebrew'\n | 'deb'\n | 'rpm'\n | 'msi'\n | 'chocolatey'\n | 'apk'\n | 'npm'\n | 'portage'\n | 'unknown';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AARA;AACA;AACA;AACA;;AAOA;AACA,eAAkEA,OAAO,CAAC,oBAAoB,CAAC;EAAxFC,OAAO,YAAPA,OAAO;EAAsBC,0BAA0B,YAA9CC,kBAAkB;AAA8D;AAAA,SAG1EC,qBAAqB;EAAA;AAAA;AAAA;EAAA,2GAApC;IAAA;IAAA;MAAA;QAAA;UACDD,kBAAkB,GAAGD,0BAA0B,EAEnD;UACA;UACA;UACA;UACA;UACA;UACA;UAAA;UAEQG,YAAY,GAAGC,kBAAI,CAACC,IAAI,CAACC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC;UAAA,KAC3DC,iBAAE,CAACC,UAAU,CAACL,YAAY,CAAC;YAAA;YAAA;UAAA;UAAA;UAAA,OAEN,IAAAM,cAAQ,EAACN,YAAY,CAAC;QAAA;UAAvCO,QAAQ;UACd,IAAIA,QAAQ,CAACT,kBAAkB,EAAE;YAC/BA,kBAAkB,GAAGS,QAAQ,CAACT,kBAAkB;UAClD;QAAC;UAAA;UAAA;QAAA;UAAA;UAAA;QAAA;UAAA,iCAKEA,kBAAkB;QAAA;QAAA;UAAA;MAAA;IAAA;EAAA,CAC1B;EAAA;AAAA"}