mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-03 14:52:55 +00:00
build: remove duplicated func FileExist (#32768)
This commit is contained in:
parent
b19452dc11
commit
943a30d1ee
2 changed files with 3 additions and 11 deletions
|
|
@ -57,6 +57,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cespare/cp"
|
"github.com/cespare/cp"
|
||||||
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/crypto/signify"
|
"github.com/ethereum/go-ethereum/crypto/signify"
|
||||||
"github.com/ethereum/go-ethereum/internal/build"
|
"github.com/ethereum/go-ethereum/internal/build"
|
||||||
"github.com/ethereum/go-ethereum/internal/download"
|
"github.com/ethereum/go-ethereum/internal/download"
|
||||||
|
|
@ -148,7 +149,7 @@ func executablePath(name string) string {
|
||||||
func main() {
|
func main() {
|
||||||
log.SetFlags(log.Lshortfile)
|
log.SetFlags(log.Lshortfile)
|
||||||
|
|
||||||
if !build.FileExist(filepath.Join("build", "ci.go")) {
|
if !common.FileExist(filepath.Join("build", "ci.go")) {
|
||||||
log.Fatal("this script must be run from the root of the repository")
|
log.Fatal("this script must be run from the root of the repository")
|
||||||
}
|
}
|
||||||
if len(os.Args) < 2 {
|
if len(os.Args) < 2 {
|
||||||
|
|
@ -895,7 +896,7 @@ func ppaUpload(workdir, ppa, sshUser string, files []string) {
|
||||||
var idfile string
|
var idfile string
|
||||||
if sshkey := getenvBase64("PPA_SSH_KEY"); len(sshkey) > 0 {
|
if sshkey := getenvBase64("PPA_SSH_KEY"); len(sshkey) > 0 {
|
||||||
idfile = filepath.Join(workdir, "sshkey")
|
idfile = filepath.Join(workdir, "sshkey")
|
||||||
if !build.FileExist(idfile) {
|
if !common.FileExist(idfile) {
|
||||||
os.WriteFile(idfile, sshkey, 0600)
|
os.WriteFile(idfile, sshkey, 0600)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,15 +25,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FileExist checks if a file exists at path.
|
|
||||||
func FileExist(path string) bool {
|
|
||||||
_, err := os.Stat(path)
|
|
||||||
if err != nil && os.IsNotExist(err) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// HashFolder iterates all files under the given directory, computing the hash
|
// HashFolder iterates all files under the given directory, computing the hash
|
||||||
// of each.
|
// of each.
|
||||||
func HashFolder(folder string, exlude []string) (map[string][32]byte, error) {
|
func HashFolder(folder string, exlude []string) (map[string][32]byte, error) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue