mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-04 21:49:50 -06:00
29 lines
741 B
JavaScript
29 lines
741 B
JavaScript
const childProcess = require('child_process')
|
|
|
|
/**
|
|
* Get the version, commit date and git sha of the latest tag published on npm.
|
|
*/
|
|
const getCurrentReleaseData = (verbose = true) => {
|
|
verbose && console.log('Get Current Release Information\n')
|
|
|
|
const stdout = childProcess.execSync('yarn info cypress --json')
|
|
const { data: npmInfo } = JSON.parse(stdout)
|
|
|
|
const latestReleaseInfo = {
|
|
version: npmInfo['dist-tags'].latest,
|
|
distTags: npmInfo['dist-tags'],
|
|
commitDate: npmInfo.buildInfo.commitDate,
|
|
buildSha: npmInfo.buildInfo.commitSha,
|
|
}
|
|
|
|
verbose && console.log({ latestReleaseInfo })
|
|
|
|
latestReleaseInfo.versions = npmInfo.versions
|
|
|
|
return latestReleaseInfo
|
|
}
|
|
|
|
module.exports = {
|
|
getCurrentReleaseData,
|
|
}
|