Copian el archivo pre-push.js a repo/.git/hooks/pre-push. Y cada ves que le dan push le cambia la versión del patch
Created
April 22, 2015 22:27
-
-
Save jamlfy/e6955639c9ae99323726 to your computer and use it in GitHub Desktop.
Change the version auto
This file contains hidden or 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
| #!/usr/bin/env node | |
| const path = require('path'); | |
| const fs = require('fs'); | |
| const URI_PACK = path.resolve('package.json'); | |
| var pack = require(URI_PACK); | |
| var vers = pack.version.split('.'); | |
| var max = vers.length -1; | |
| vers[max] = parseFloat(vers[ max ]) + 1; | |
| pack.version = vers.join('.'); | |
| fs.writeFile(URI_PACK, JSON.stringify(pack, null, '\t'), function (err) { | |
| if (err) throw err; | |
| console.log('Change version Patch'); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment