-
Notifications
You must be signed in to change notification settings - Fork 12
/
mvp.js
36 lines (32 loc) · 1.03 KB
/
mvp.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
30
31
32
33
34
35
36
var yeomanTest = require('yeoman-test');
var rimraf = require('rimraf');
var path = require('path');
var fs = require('fs');
var archiver = require('archiver');
var context = yeomanTest.run(path.resolve('./generators/app'));
context.settings.tmpdir = false; // don't run in tempdir
yeomanTest.testDirectory("MyApp", function() {
context.withPrompts({
name: 'SampleApp',
package: 'com.sample.mvp',
targetSdk: '21',
minSdk: '14'
})
.on('end', function () {
// create a file to stream archive data to.
var output = fs.createWriteStream(__dirname + '/MyApp.zip');
var archive = archiver('zip', {
store: true // Sets the compression method to STORE.
})
output.on('close', function() {
console.log(archive.pointer() + ' total bytes');
console.log('archiver has been finalized and the output file descriptor has closed.');
});
archive.on('error', function(err) {
console.log(err);
});
archive.pipe(output);
archive.directory(__dirname + '/MyApp/');
archive.finalize();
});
})