mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00: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:
parent
996ec67229
commit
194b3b1c5e
@ -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])
|
||||
}
|
||||
|
@ -18,7 +18,10 @@ go_library(
|
||||
],
|
||||
importpath = "github.com/prysmaticlabs/prysm/v4/tools/specs-checker",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = ["@com_github_urfave_cli_v2//:go_default_library"],
|
||||
deps = [
|
||||
"//config/params:go_default_library",
|
||||
"@com_github_urfave_cli_v2//:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/v4/config/params"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
@ -40,7 +41,7 @@ func download(cliCtx *cli.Context) error {
|
||||
|
||||
func getAndSaveFile(specDocUrl, outFilePath string) error {
|
||||
// Create output file.
|
||||
f, err := os.Create(filepath.Clean(outFilePath))
|
||||
f, err := os.OpenFile(filepath.Clean(outFilePath), os.O_CREATE|os.O_EXCL, params.BeaconIoConfig().ReadWritePermissions)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot create output file: %w", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user