mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-06-13 10:59:37 +00:00
91d37be1da
* github.com/Microsoft/go-winio * github.com/bradrydzewski/togo * github.com/containerd/containerd * github.com/docker/cli * github.com/docker/docker * github.com/docker/docker-credential-helpers * github.com/franela/goblin * github.com/google/go-github/v39 * github.com/joho/godotenv * github.com/lib/pq * github.com/moby/moby * github.com/prometheus/client_golang * github.com/tevino/abool * github.com/woodpecker-ci/togo * github.com/xanzy/go-gitlab * github.com/xeipuuv/gojsonschema * github.com/mattn/go-sqlite3
22 lines
509 B
Go
22 lines
509 B
Go
package credentials
|
|
|
|
import (
|
|
exec "golang.org/x/sys/execabs"
|
|
)
|
|
|
|
// DetectDefaultStore return the default credentials store for the platform if
|
|
// the store executable is available.
|
|
func DetectDefaultStore(store string) string {
|
|
platformDefault := defaultCredentialsStore()
|
|
|
|
// user defined or no default for platform
|
|
if store != "" || platformDefault == "" {
|
|
return store
|
|
}
|
|
|
|
if _, err := exec.LookPath(remoteCredentialsPrefix + platformDefault); err == nil {
|
|
return platformDefault
|
|
}
|
|
return ""
|
|
}
|