Created
November 5, 2021 16:53
-
-
Save barata0/0a746444aca5304da1d588aba820939a to your computer and use it in GitHub Desktop.
bump openapi version javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const yaml = require('js-yaml'); | |
const fs = require('fs'); | |
const bump = (filename) => { | |
try { | |
const doc = yaml.load(fs.readFileSync(filename, 'utf8')); | |
const version = doc.info.version.split('.').map(a => parseInt(a)); | |
console.log('openApi from', version) | |
version[2]++ | |
console.log('openApi to ', version) | |
doc.info.version = version.join('.') | |
fs.writeFileSync(filename, yaml.dump(doc)); | |
} catch (e) { | |
console.log(e); | |
} | |
} | |
bump('../.trampolin.v3.yaml') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment