forked from Orbs/git-download
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
30 lines (27 loc) · 989 Bytes
/
test.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
var options = {
// Remote source location (note that github doesn't support git archive requests)
// source: 'ssh://stash.nikedev.com/~tmil11/idicons.git',
source: 'ssh://[email protected]/dgkang/node-buffer.git',
// Destination for exploded files from downloaded tar file
dest: '/tmp/node-buffer',
// Branch and folder path to include
branch: 'master', // 'master:lib'
// Location to save tarfile, defaults to /tmp if not specified
// tarfile: '/tmp/node-buffer.tar',
tmpDir: '/tmp',
// Optional prefix to add to all root filenames in tarfile
// prefix: 'node-buffer/',
// Does not remove downloaded tarfile if true, otherwise tarfile is removed
savetar: true
};
var download = require('./index');
download(options, function(err, tarfile) {
if (err) {
console.error('Error occurred downloading '+options.source);
return;
}
console.log('Successfully downloaded '+options.source);
if (tarfile) {
console.log('Output: '+tarfile);
}
});