本文整理匯總了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());
},