Created
January 19, 2018 13:45
-
-
Save allomov/5e79a213d189c3c6d1775828aca5d8f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var {Checkout, Submodule, Repository} = require("nodegit"); | |
Repository.open("/native-repo") | |
.then(function(repository) { | |
return repository.getTagByName("v1.0.8") | |
.then(function(result) { console.dir(result); return result; }) | |
.then(function(tag) { console.dir([tag.targetId(), repository.defaultSignature, "Checkout: HEAD " + tag.targetId()]); return tag; }) | |
.then(function(tag) { repository.setHeadDetached(tag.targetId(), repository.defaultSignature, "Checkout: HEAD " + tag.targetId()) }) | |
}) | |
.then(function() { console.log("done");}) | |
.done() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment