* Updates package.json version
(packageDirName: string, newVersion: string)
| 186 | * Updates package.json version |
| 187 | */ |
| 188 | function updatePackageJson(packageDirName: string, newVersion: string) { |
| 189 | if (preview) { |
| 190 | console.log(` • Would update package.json to ${newVersion}`); |
| 191 | return; |
| 192 | } |
| 193 | |
| 194 | let packageJsonPath = getPackageFile(packageDirName, "package.json"); |
| 195 | let packageJson = readJson(packageJsonPath); |
| 196 | packageJson.version = newVersion; |
| 197 | writeJson(packageJsonPath, packageJson); |
| 198 | console.log(` ✓ Updated package.json to ${newVersion}`); |
| 199 | } |
| 200 | |
| 201 | /** |
| 202 | * Updates CHANGELOG.md with new content |
no test coverage detected