本文整理汇总了TypeScript中nodegit.Cred类的典型用法代码示例。如果您正苦于以下问题:TypeScript Cred类的具体用法?TypeScript Cred怎么用?TypeScript Cred使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Cred类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: pushBranch
/**
* Pushes the given element's local branch name up to
* the remote branch name on github.
*
* returns a promise
*/
async function pushBranch(
element: ElementRepo, localBranchName: string, remoteBranchName: string) {
const remote = await element.repo.getRemote('origin');
return remote.push(
['refs/heads/' + localBranchName + ':refs/heads/' + remoteBranchName], {
callbacks: {
credentials() {
return nodegit.Cred.userpassPlaintextNew(
GITHUB_TOKEN, 'x-oauth-basic');
}
}
});
}
示例2: function
credentials: function () {
return Git.Cred.userpassPlaintextNew(token, "x-oauth-basic");
}
示例3: function
credentials: function(url, userName) {
return nodegit.Cred.sshKeyFromAgent(userName);
}
示例4: function
credentials: function () {
return Git.Cred.userpassPlaintextNew(getUsernameTemp(), getPasswordTemp());
},