Created
October 30, 2020 19:21
-
-
Save wess/f9e8a9a48f0fecee5019def933d95df1 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
this.openRepo = await Repository.init(this.target, 0) | |
const origin = `git@github.com:wess/spose.git` | |
const index = await this.openRepo.refreshIndex() | |
const oid = await index.addAll() | |
await index.write() | |
const toid = await index.writeTree() | |
const commit = await this.openRepo.createCommit("HEAD", this.signature, this.signature, "initial commit", toid, []) | |
const remote = await Remote.create(this.openRepo, "origin", origin) | |
// Cred.sshKeyNew( | |
// username, | |
// env.keys.public, | |
// env.keys.private, | |
// '' | |
// ) | |
return remote.push( | |
["refs/heads/master:refs/heads/master"], | |
{ | |
callbacks: { | |
certificateCheck: () => 1, | |
credentials: (_url, username) => Cred.sshKeyFromAgent(username) | |
} | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment