mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 05:37:53 +08:00
Plugins: Require signing of external back-end plugins (#24075)
* PluginManager: Require signing of external plugins Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
This commit is contained in:
18
pkg/infra/fs/exists.go
Normal file
18
pkg/infra/fs/exists.go
Normal file
@ -0,0 +1,18 @@
|
||||
package fs
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// Exists determines whether a file/directory exists or not.
|
||||
func Exists(fpath string) (bool, error) {
|
||||
_, err := os.Stat(fpath)
|
||||
if err != nil {
|
||||
if !os.IsNotExist(err) {
|
||||
return false, err
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
Reference in New Issue
Block a user