Skip to content

Commit 8506207

Browse files
committed
update gokit
1 parent 5b49441 commit 8506207

File tree

15 files changed

+36
-38
lines changed

15 files changed

+36
-38
lines changed

cmd/bob/baseimageconf.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package main
33
import (
44
"fmt"
55

6-
"github.com/function61/gokit/fileexists"
7-
"github.com/function61/gokit/jsonfile"
6+
"github.com/function61/gokit/encoding/jsonfile"
7+
"github.com/function61/gokit/os/osutil"
88
)
99

1010
const (
@@ -22,7 +22,7 @@ type BaseImageConfig struct {
2222
// base image conf is optional. if it doesn't exist, an empty (but valid) conf will be
2323
// returned without error
2424
func loadBaseImageConf() (*BaseImageConfig, error) {
25-
exists, err := fileexists.Exists(baseImageJsonLocation)
25+
exists, err := osutil.Exists(baseImageJsonLocation)
2626
if err != nil {
2727
return nil, fmt.Errorf("loadBaseImageConf: %w", err)
2828
}

cmd/bob/bobfile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"os"
66

7-
"github.com/function61/gokit/jsonfile"
7+
"github.com/function61/gokit/encoding/jsonfile"
88
"github.com/function61/turbobob/pkg/versioncontrol"
99
)
1010

cmd/bob/build.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import (
66
"os/exec"
77
"strings"
88

9-
"github.com/function61/gokit/envvar"
10-
"github.com/function61/gokit/fileexists"
11-
"github.com/function61/gokit/osutil"
9+
"github.com/function61/gokit/os/osutil"
1210
"github.com/function61/turbobob/pkg/versioncontrol"
1311
"github.com/spf13/cobra"
1412
)
@@ -145,7 +143,7 @@ func buildAndPushOneDockerImage(dockerImage DockerImageSpec, buildCtx *BuildCont
145143

146144
func cloneToWorkdir(buildCtx *BuildContext) error {
147145
rootForProject := projectSpecificDir(buildCtx.Bobfile.ProjectName, "")
148-
rootForProjectExists, rootForProjectExistsErr := fileexists.Exists(rootForProject)
146+
rootForProjectExists, rootForProjectExistsErr := osutil.Exists(rootForProject)
149147
if rootForProjectExistsErr != nil {
150148
return rootForProjectExistsErr
151149
}
@@ -158,7 +156,7 @@ func cloneToWorkdir(buildCtx *BuildContext) error {
158156
}
159157
}
160158

161-
workspaceDirExists, workspaceDirExistsErr := fileexists.Exists(buildCtx.WorkspaceDir)
159+
workspaceDirExists, workspaceDirExistsErr := osutil.Exists(buildCtx.WorkspaceDir)
162160
if workspaceDirExistsErr != nil {
163161
return workspaceDirExistsErr
164162
}
@@ -414,7 +412,7 @@ func buildInside(fastBuild bool) error {
414412

415413
// pass almost all of our environment variables
416414
for _, envSerialized := range os.Environ() {
417-
if key, _ := envvar.Parse(envSerialized); key == "FASTBUILD" {
415+
if key, _ := osutil.Parse(envSerialized); key == "FASTBUILD" {
418416
// since we have explicit interface from here on, ignore setting any previous
419417
// value so we can control whether we set this or not
420418
continue

cmd/bob/checks.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"fmt"
55

6-
"github.com/function61/gokit/fileexists"
6+
"github.com/function61/gokit/os/osutil"
77
)
88

99
func RunChecks(buildCtx *BuildContext) ([]CheckResult, error) {
@@ -31,7 +31,7 @@ func RunChecks(buildCtx *BuildContext) ([]CheckResult, error) {
3131
func licensePresent(ctx *CheckContext) error {
3232
licenseCheck := ctx.NewCheck("License present")
3333

34-
exists, errChecking := fileexists.Exists("LICENSE")
34+
exists, errChecking := osutil.Exists("LICENSE")
3535
if errChecking != nil {
3636
return errChecking
3737
}
@@ -48,7 +48,7 @@ func licensePresent(ctx *CheckContext) error {
4848
func readmePresent(ctx *CheckContext) error {
4949
readmeCheck := ctx.NewCheck("Readme present")
5050

51-
exists, errChecking := fileexists.Exists("README.md")
51+
exists, errChecking := osutil.Exists("README.md")
5252
if errChecking != nil {
5353
return errChecking
5454
}

cmd/bob/dev.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"runtime"
1010
"strings"
1111

12-
"github.com/function61/gokit/jsonfile"
13-
"github.com/function61/gokit/osutil"
12+
"github.com/function61/gokit/encoding/jsonfile"
13+
"github.com/function61/gokit/os/osutil"
1414
"github.com/function61/turbobob/pkg/versioncontrol"
1515
"github.com/spf13/cobra"
1616
)

cmd/bob/devshim.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"strings"
1111
"syscall"
1212

13-
"github.com/function61/gokit/fileexists"
14-
"github.com/function61/gokit/jsonfile"
13+
"github.com/function61/gokit/encoding/jsonfile"
14+
"github.com/function61/gokit/os/osutil"
1515
"github.com/spf13/cobra"
1616
)
1717

@@ -67,7 +67,7 @@ func devShimEntry() *cobra.Command {
6767

6868
func shimSetup() error {
6969
// some things must not be done again
70-
alreadyDone, err := fileexists.Exists(shimSetupDoneFlagPath())
70+
alreadyDone, err := osutil.Exists(shimSetupDoneFlagPath())
7171
if err != nil {
7272
return err
7373
}
@@ -204,7 +204,7 @@ func shimExitIfErr(prefix string, err error) {
204204
// make various dirs symlinks to a bind mount from host, so cache can be shared between
205205
// multiple container instances
206206
func makeCacheDir(dir string) error {
207-
exists, err := fileexists.Exists(dir)
207+
exists, err := osutil.Exists(dir)
208208
if err != nil {
209209
return err
210210
}

cmd/bob/info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"strings"
66

7-
"github.com/function61/gokit/osutil"
7+
"github.com/function61/gokit/os/osutil"
88
"github.com/scylladb/termtables"
99
"github.com/spf13/cobra"
1010
)

cmd/bob/init.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import (
99
"strings"
1010

1111
"github.com/function61/gokit/dynversion"
12-
"github.com/function61/gokit/fileexists"
13-
"github.com/function61/gokit/osutil"
12+
"github.com/function61/gokit/os/osutil"
1413
"github.com/spf13/cobra"
1514
)
1615

@@ -20,7 +19,7 @@ const (
2019
)
2120

2221
func writeTravisBoilerplate() error {
23-
exists, errExistsCheck := fileexists.Exists(travisFilePath)
22+
exists, errExistsCheck := osutil.Exists(travisFilePath)
2423
if errExistsCheck != nil {
2524
return errExistsCheck
2625
}
@@ -46,7 +45,7 @@ script:
4645
}
4746

4847
func writeGitLabBoilerplate() error {
49-
exists, errExistsCheck := fileexists.Exists(gitlabFilePath)
48+
exists, errExistsCheck := osutil.Exists(gitlabFilePath)
5049
if errExistsCheck != nil {
5150
return errExistsCheck
5251
}
@@ -76,7 +75,7 @@ build:
7675
}
7776

7877
func writeDefaultBobfile(producesDockerImage bool) error {
79-
exists, errExistsCheck := fileexists.Exists(bobfileName)
78+
exists, errExistsCheck := osutil.Exists(bobfileName)
8079
if errExistsCheck != nil {
8180
return errExistsCheck
8281
}

cmd/bob/main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import (
55
"os"
66

77
"github.com/function61/gokit/dynversion"
8-
"github.com/function61/gokit/fileexists"
9-
"github.com/function61/gokit/osutil"
8+
"github.com/function61/gokit/os/osutil"
109
"github.com/function61/turbobob/pkg/powerline"
1110
"github.com/spf13/cobra"
1211
)
@@ -65,5 +64,5 @@ func main() {
6564
}
6665

6766
func insideDevContainer() (bool, error) {
68-
return fileexists.Exists(shimDataDirContainer)
67+
return osutil.Exists(shimDataDirContainer)
6968
}

cmd/bob/subrepo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ package main
33
import (
44
"fmt"
55

6-
"github.com/function61/gokit/fileexists"
6+
"github.com/function61/gokit/os/osutil"
77
"github.com/function61/turbobob/pkg/versioncontrol"
88
)
99

1010
func ensureSubrepoCloned(destination string, subrepo SubrepoSpec) error {
11-
exists, err := fileexists.Exists(destination)
11+
exists, err := osutil.Exists(destination)
1212
if err != nil {
1313
return err
1414
}

0 commit comments

Comments
 (0)