mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-15 00:35:14 +00:00
feat: store keys as JWK on disk (#339)
Co-authored-by: Kyle Mendell <kmendell@ofkm.us>
This commit is contained in:
committed by
GitHub
parent
e9b2d981b7
commit
a7c9741802
@@ -78,3 +78,15 @@ func SaveFile(file *multipart.FileHeader, dst string) error {
|
||||
_, err = io.Copy(out, src)
|
||||
return err
|
||||
}
|
||||
|
||||
// FileExists returns true if a file exists on disk and is a regular file
|
||||
func FileExists(path string) (bool, error) {
|
||||
s, err := os.Stat(path)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
err = nil
|
||||
}
|
||||
return false, err
|
||||
}
|
||||
return !s.IsDir(), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user