-
Notifications
You must be signed in to change notification settings - Fork 1
/
util.js
29 lines (24 loc) · 905 Bytes
/
util.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require('shelljs/global');
var shared = require('./shared');
module.exports = {
/**
* Generic output build filename builder
*/
buildFileName: function(input, architecture) {
return input.replace('%VERSION%', shared.getVersion()).replace('%ARCHITECTURE%', architecture);
},
zipBinary: function(build, zipfilename, filemask) {
echo("Building zip: " + zipfilename);
pushd(shared.BUILD_DIR + "/" + build);
exec('zip -q -r ' + shared.BINARY_OUTPUT_DIR + "/" + zipfilename + " " + (filemask || '*'));
echo("Done. " + zipfilename);
popd();
},
tgzBinary: function(build, tgzfilename) {
echo("Building tgz: " + tgzfilename);
pushd(shared.BUILD_DIR + "/" + build);
exec("tar -czf " + shared.BINARY_OUTPUT_DIR + "/" + tgzfilename + " " + '*');
echo("Done. " + tgzfilename);
popd();
}
}