change-version
is a command-line utility designed to update version numbers in project files. It currently supports CMake, NodeJS, and Doxygen projects. The tool automates the process of parsing and modifying version numbers within these files.
- CMake: Automatically updates version numbers in
CMakeLists.txt
. - NodeJS: Modifies the version in
package.json
. - Doxygen: Adjusts version numbers in Doxygen configuration files.
You can install change-version
via npm:
npm install -g @niu2x/change-version
The basic syntax for using change-version
is as follows:
change-version <projectType> -i -v <newVersion> <filePath>
<projectType>
: The type of project file to modify (CMake
,NodeJS
, orDoxygen
).-i
: In-place modification of the file.-v <newVersion>
: The new version number to set.<filePath>
: The path to the project file.
To update the version number in a CMakeLists.txt
file:
change-version CMake -i -v 1.1.1 /path/to/CMakeLists.txt
To change the version in a package.json
file:
change-version Node -i -v 1.1.1 /path/to/package.json
To update the version in a Doxygen configuration file:
change-version Doxygen -i -v 1.1.1 /path/to/Doxyfile