Skip to content

Commit

Permalink
deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ucwong committed Oct 31, 2024
1 parent aec0024 commit 4943737
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
4 changes: 2 additions & 2 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func executablePath(name string) string {
func main() {
log.SetFlags(log.Lshortfile)

if !common.FileExist(filepath.Join("build", "ci.go")) {
if !build.FileExist(filepath.Join("build", "ci.go")) {
log.Fatal("this script must be run from the root of the repository")
}
if len(os.Args) < 2 {
Expand Down Expand Up @@ -780,7 +780,7 @@ func ppaUpload(workdir, ppa, sshUser string, files []string) {
var idfile string
if sshkey := getenvBase64("PPA_SSH_KEY"); len(sshkey) > 0 {
idfile = filepath.Join(workdir, "sshkey")
if !common.FileExist(idfile) {
if !build.FileExist(idfile) {
os.WriteFile(idfile, sshkey, 0600)
}
}
Expand Down
1 change: 0 additions & 1 deletion common/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ func FileExist(filePath string) bool {
if err != nil && os.IsNotExist(err) {
return false
}

return true
}

Expand Down
28 changes: 28 additions & 0 deletions internal/build/file.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2024 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

package build

import "os"

// 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
}

0 comments on commit 4943737

Please sign in to comment.