refactor
This commit is contained in:
19
js/git.js
Normal file
19
js/git.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const _ = require("lodash");
|
||||
|
||||
const path = x => require("../" + x);
|
||||
const immutable = path("js/immutable");
|
||||
const shell = path("js/shell");
|
||||
|
||||
let lib;
|
||||
|
||||
function setCurrentBranch(dp) {
|
||||
const cmd = "git rev-parse --abbrev-ref HEAD";
|
||||
|
||||
return shell.capture(cmd).then(x => immutable.set(dp, "currentBranch", x));
|
||||
}
|
||||
|
||||
lib = {
|
||||
setCurrentBranch
|
||||
};
|
||||
|
||||
module.exports = lib;
|
||||
Reference in New Issue
Block a user