I'm trying to make an updater for my Electron app, I only want to update the html code that will be fetched from git. But I only want to fetch code if the origin has new commits, that way I can reload the browser if the app was updated. How can I do that?
Here's my latest code:
var Git = require("nodegit");
var pathToRepo = require("path").resolve("data");
Git.Repository.open(pathToRepo).then(function (repo) {
return Git.Remote.load(repo, "origin");
}).then(function(remote) {
remote.connect(0);
return remote.download();
})
.done(function() {
console.log("Updated app");
});