Created
October 7, 2014 02:01
-
-
Save TrainerGuy22/d1d547c41071ed324176 to your computer and use it in GitHub Desktop.
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
function endsWith(str, suffix) { | |
return str.indexOf(suffix, str.length - suffix.length) !== -1; | |
} | |
var fs = require('fs'); | |
fs.readdir(process.env.PWD, function(err, files) { | |
if(err) throw err; | |
files.forEach(function(obj) { | |
if(endsWith(obj, '.jar')) { | |
fs.rename(process.env.PWD + obj, process.env.PWD + obj.substring(obj.length - 4) + process.env.BUILD_NUMBER + '.jar', function(err) { | |
if(err) { throw err; } | |
}); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment