forked from nodegit/nodegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunner.js
More file actions
28 lines (23 loc) · 853 Bytes
/
Copy pathrunner.js
File metadata and controls
28 lines (23 loc) · 853 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
var promisify = require("promisify-node");
var fs = promisify("fs");
// Have to wrap exec, since it has a weird callback signature.
var exec = promisify(function(command, callback) {
return require("child_process").exec(command, callback);
});
before(function(done) {
this.timeout(150000);
var url = "https://github.com/nodegit/nodegit";
var done = done.bind(null, null);
fs.exists("test/repos").then(function() {
return fs.mkdir("test/repos").then(function() {
return exec("git init test/repos/empty");
}).then(function() {
return exec("git clone " + url + " test/repos/workdir");
}).then(function() {
var nonrepo = "test/repos/nonrepo";
return fs.mkdir(nonrepo).then(function() {
return fs.writeFile(nonrepo + "/file.txt", "This is a bogus file");
});
})
}).then(done, done);
});