Skip to content

Version reader/writer for popular package managers as per SemVer

Notifications You must be signed in to change notification settings

VeritasOS/versioner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Versioner

Version reader/writer for popular package managers as per SemVer

Installation

pip install git+https://github.com/VeritasOS/versioner.git

Current support

  • npm
  • dep
  • json
  • toml
  • yaml (currently multi doc in single file not supported)

Usage

  • Read version (run command from project root)

      > versioner read npm  # projects based on npm
      "0.0.1"
    
      > versioner read dep  # golang projects
      "0.1.1"
    
  • Write version (run command from project root)

      # package.json
      ....
      "version": "1.1.1",
      ....
    
      # Release patch version
      > versioner write npm --inc-patch
    
      # package.json
      ....
      "version": "1.1.2",
      ....
    
      # Release minor version
      > versioner write npm --inc-minor
    
      ....
      "version": "1.2.0",
      ....
    
      # Release major version
      > versioner write npm --inc-major
    
      ....
      "version": "2.0.0",
      ....
    
  • Read version from custom file

      > versioner read yaml --file /root/app/version.yaml --key-depth metadata,version
      0.0.2
    
      version.yaml
      ---
      metadata:
        version: 0.0.2
    
  • Write version to custom file

      > versioner write yaml --inc-major --file /root/app/version.yaml --key-depth metadata,version
    
      version.yaml
      ---
      metadata:
        version: 1.0.0
    

Development

git clone https://github.com/VeritasOS/versioner.git
cd versioner
pip install -e .

NOTE

  • This utility is tested for npm and dep.
  • Read/write for custom file may break, please feel free to send a patch.

About

Version reader/writer for popular package managers as per SemVer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages