MCPcopy Index your code
hub / github.com/desktop/desktop / commandPrepare

Function commandPrepare

script/draft-release/ci.ts:134–151  ·  view source on GitHub ↗
(nextVersion: string, entriesJson: string)

Source from the content-addressed store, hash-verified

132}
133
134function commandPrepare(nextVersion: string, entriesJson: string): void {
135 // Bump app/package.json
136 const pkgPath = join(repoRoot, 'app', 'package.json')
137 const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'))
138 pkg.version = nextVersion
139 writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n')
140 console.log(`✅ Set app/package.json version to ${nextVersion}`)
141
142 // Prepend to changelog.json
143 const changelogPath = join(repoRoot, 'changelog.json')
144 const changelog = JSON.parse(readFileSync(changelogPath, 'utf8'))
145 const entries: ReadonlyArray<string> = JSON.parse(entriesJson)
146 changelog.releases = { [nextVersion]: entries, ...changelog.releases }
147 writeFileSync(changelogPath, JSON.stringify(changelog, null, 2) + '\n')
148 console.log(
149 `✅ Added ${entries.length} entries to changelog.json under ${nextVersion}`
150 )
151}
152
153async function main(): Promise<void> {
154 const [command, ...args] = process.argv.slice(2)

Callers 1

mainFunction · 0.85

Calls 2

parseMethod · 0.65
logMethod · 0.45

Tested by

no test coverage detected