mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Ensure File Does Not Exist (#12536)
* error out * gaz --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,7 @@ go_library(
|
||||
importpath = "github.com/prysmaticlabs/prysm/v4/tools/interop/convert-keys",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//config/params:go_default_library",
|
||||
"//tools/unencrypted-keys-gen/keygen:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
"@in_gopkg_yaml_v2//:go_default_library",
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/v4/config/params"
|
||||
"github.com/prysmaticlabs/prysm/v4/tools/unencrypted-keys-gen/keygen"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"gopkg.in/yaml.v2"
|
||||
@@ -52,7 +53,7 @@ func main() {
|
||||
})
|
||||
}
|
||||
|
||||
outFile, err := os.Create(os.Args[2])
|
||||
outFile, err := os.OpenFile(os.Args[2], os.O_CREATE|os.O_EXCL, params.BeaconIoConfig().ReadWritePermissions)
|
||||
if err != nil {
|
||||
log.WithError(err).Fatalf("Failed to create file at %s", os.Args[2])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user