Skip to content

Commit 27b6d31

Browse files
committed
address PR comments
1 parent e06091f commit 27b6d31

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

local/network.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ func (ln *localNetwork) buildArgs(
11391139
config.BootstrapIDsKey: ln.bootstraps.IDsArg(),
11401140
}
11411141

1142-
insideContainer, err := utils.InsideDockerContainer()
1142+
insideContainer, err := utils.IsInsideDockerContainer()
11431143
if err != nil {
11441144
return buildArgsReturn{}, err
11451145
}

utils/utils.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,12 @@ func VerifySubnetHasCorrectParticipants(
142142
return false
143143
}
144144

145-
func InsideDockerContainer() (bool, error) {
146-
_, err := os.Stat(dockerEnvPath)
145+
func IsInsideDockerContainer() (bool, error) {
146+
return PathExists(dockerEnvPath)
147+
}
148+
149+
func PathExists(path string) (bool, error) {
150+
_, err := os.Stat(path)
147151
if err != nil {
148152
if errors.Is(err, fs.ErrNotExist) {
149153
return false, nil

0 commit comments

Comments
 (0)