refactor: switch to pkg/jsonnetfile

So far, `pkg` and `pkg/jsonnetfile` had overlapping functionality when it came
to choosing and loading jsonnetfiles.

This fully switches to the separate package `pkg/jsonnetfile` that seems to be
created for exactly this purpose
This commit is contained in:
sh0rez 2019-10-16 12:07:10 +02:00
parent a718f48cd8
commit 71938456ae
No known key found for this signature in database
GPG key ID: 87C71DF9F8181FF1
10 changed files with 55 additions and 180 deletions

View file

@ -18,13 +18,13 @@ import (
"io/ioutil"
"path/filepath"
"github.com/jsonnet-bundler/jsonnet-bundler/pkg"
kingpin "gopkg.in/alecthomas/kingpin.v2"
"github.com/jsonnet-bundler/jsonnet-bundler/pkg/jsonnetfile"
"gopkg.in/alecthomas/kingpin.v2"
)
func initCommand(dir string) int {
exists, err := pkg.FileExists(jsonnetfile.File)
exists, err := jsonnetfile.Exists(jsonnetfile.File)
if err != nil {
kingpin.Errorf("Failed to check for jsonnetfile.json: %v", err)
return 1