mirror of
https://github.com/desktop/desktop
synced 2024-08-24 18:57:33 +00:00
remove duplicate-ish changelog task
This commit is contained in:
parent
ed60d52078
commit
63ca4324fb
|
@ -39,7 +39,6 @@
|
|||
"clean-slate": "rimraf out node_modules app/node_modules coverage && yarn",
|
||||
"rebuild-hard:dev": "yarn clean-slate && yarn build:dev",
|
||||
"rebuild-hard:prod": "yarn clean-slate && yarn build:prod",
|
||||
"changelog": "ts-node script/changelog/index.ts",
|
||||
"draft-release": "ts-node script/draft-release/index.ts",
|
||||
"draft-release:format": "prettier --check --write changelog.json app/package.json && yarn validate-changelog",
|
||||
"validate-changelog": "ts-node script/validate-changelog.ts",
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
/// <reference path="../globals.d.ts" />
|
||||
|
||||
import { run } from './run'
|
||||
|
||||
if (!process.env.GITHUB_ACCESS_TOKEN) {
|
||||
console.log('You need to provide a GITHUB_ACCESS_TOKEN environment variable')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
process.on('unhandledRejection', error => {
|
||||
console.error(error.message)
|
||||
})
|
||||
|
||||
const args = process.argv.splice(2)
|
||||
run(args)
|
|
@ -1,53 +0,0 @@
|
|||
import { spawn } from './spawn'
|
||||
import { getLogLines } from './git'
|
||||
import { convertToChangelogFormat } from './parser'
|
||||
import { sort as semverSort } from 'semver'
|
||||
|
||||
const jsonStringify: (obj: any) => string = require('json-pretty')
|
||||
|
||||
export async function run(args: ReadonlyArray<string>): Promise<void> {
|
||||
try {
|
||||
await spawn('git', ['--version'])
|
||||
} catch {
|
||||
throw new Error('Unable to find Git on your PATH, aborting...')
|
||||
}
|
||||
|
||||
try {
|
||||
await spawn('git', ['rev-parse', '--show-cdup'])
|
||||
} catch {
|
||||
throw new Error(
|
||||
`The current directory '${process.cwd()}' is not a Git repository, aborting...`
|
||||
)
|
||||
}
|
||||
|
||||
if (args.length === 0) {
|
||||
// work out the latest tag created in the repository
|
||||
const allTags = await spawn('git', ['tag'])
|
||||
const releaseTags = allTags
|
||||
.split('\n')
|
||||
.filter(tag => tag.startsWith('release-'))
|
||||
.filter(tag => tag.indexOf('-linux') === -1)
|
||||
.filter(tag => tag.indexOf('-test') === -1)
|
||||
.map(tag => tag.substr(8))
|
||||
|
||||
const sortedTags = semverSort(releaseTags)
|
||||
const latestTag = sortedTags[sortedTags.length - 1]
|
||||
|
||||
throw new Error(
|
||||
`No tag specified to use as a starting point.\nThe latest tag specified is 'release-${latestTag}' - did you mean that?`
|
||||
)
|
||||
}
|
||||
|
||||
const previousVersion = args[0]
|
||||
try {
|
||||
await spawn('git', ['rev-parse', previousVersion])
|
||||
} catch {
|
||||
throw new Error(
|
||||
`Unable to find ref '${previousVersion}' in your repository, aborting...`
|
||||
)
|
||||
}
|
||||
|
||||
const lines = await getLogLines(previousVersion)
|
||||
const changelogEntries = await convertToChangelogFormat(lines)
|
||||
console.log(jsonStringify(changelogEntries))
|
||||
}
|
Loading…
Reference in a new issue