public class NpmProjectType extends Object
| Constructor and Description |
|---|
NpmProjectType() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
check(File directory)
Check if the project is a NPM project (i.e a package.json is found).
|
com.github.zafarkhaja.semver.Version |
getCurrentVersion(File directory,
ProcessHelper processHelper)
Return the next version of the version attribute.
|
void |
writeVersion(File directory,
com.github.zafarkhaja.semver.Version nextVersion,
ProcessHelper processHelper)
Write back to the
package.json file the next version.Use the npm command version, see : https://docs.npmjs.com/cli/v6/commands/npm-version. |
public boolean check(File directory)
directory - The directory of the project.public com.github.zafarkhaja.semver.Version getCurrentVersion(File directory, ProcessHelper processHelper) throws IOException
directory - The project's directory.processHelper - Not used.IOException - If an error occur reading files.public void writeVersion(File directory, com.github.zafarkhaja.semver.Version nextVersion, ProcessHelper processHelper) throws IOException, InterruptedException
package.json file the next version.version, see : https://docs.npmjs.com/cli/v6/commands/npm-version.directory - The directory where write the file.nextVersion - The next version to use.processHelper - The helper to run the command.IOException - If errors occurs when write the fileInterruptedException - It errors occurs with the npm command.Copyright © 2016–2021. All rights reserved.