mirror of
https://github.com/gabrie30/ghorg.git
synced 2025-08-07 06:47:14 +02:00
Bumps code.gitea.io/sdk/gitea from 0.15.1 to 0.16.0. --- updated-dependencies: - dependency-name: code.gitea.io/sdk/gitea dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
29 lines
558 B
Go
29 lines
558 B
Go
// Copyright 2022 The Gitea Authors. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
//go:build windows
|
|
|
|
package gitea
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/davidmz/go-pageant"
|
|
"golang.org/x/crypto/ssh/agent"
|
|
)
|
|
|
|
// hasAgent returns true if pageant is available
|
|
func hasAgent() bool {
|
|
return pageant.Available()
|
|
}
|
|
|
|
// GetAgent returns a ssh agent
|
|
func GetAgent() (agent.Agent, error) {
|
|
if !hasAgent() {
|
|
return nil, fmt.Errorf("no pageant available")
|
|
}
|
|
|
|
return pageant.New(), nil
|
|
}
|