-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathmake.js
More file actions
33 lines (25 loc) · 740 Bytes
/
make.js
File metadata and controls
33 lines (25 loc) · 740 Bytes
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
30
31
32
33
require("shelljs/make")
var archiver = require("archiver");
var fs = require("fs");
var path = require("path");
var WIDGETNAME = "CameraWidgetForPhoneGap";
target.all = function() {
target.mpk();
};
target.mpk = function() {
var zipStream = fs.createWriteStream(path.join("dist", WIDGETNAME + ".mpk"));
var archive = archiver("zip", {});
zipStream.on("close", function() {
console.log("Written %d bytes to %s", archive.pointer(), zipStream.path);
});
zipStream.on("error", function(e) {
console.error("Error: %s", err.toString());
});
archive.pipe(zipStream);
archive
.glob("**", {
cwd: "src",
ignore: "**/*.swp"
})
.finalize();
};