mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2025-12-12 08:00:05 +01:00
feat(spec): version field (#85)
Adds a `version` field to the `jsonnetfile.json`, so that `jb` can automatically recognize too old / too new schema versions, instead of panicking.
This commit is contained in:
parent
efe0c9e864
commit
bcd89fd33d
23 changed files with 454 additions and 102 deletions
|
|
@ -19,12 +19,12 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
|
||||
kingpin "gopkg.in/alecthomas/kingpin.v2"
|
||||
"gopkg.in/alecthomas/kingpin.v2"
|
||||
|
||||
"github.com/jsonnet-bundler/jsonnet-bundler/pkg"
|
||||
"github.com/jsonnet-bundler/jsonnet-bundler/pkg/jsonnetfile"
|
||||
"github.com/jsonnet-bundler/jsonnet-bundler/spec"
|
||||
"github.com/jsonnet-bundler/jsonnet-bundler/spec/deps"
|
||||
v1 "github.com/jsonnet-bundler/jsonnet-bundler/spec/v1"
|
||||
"github.com/jsonnet-bundler/jsonnet-bundler/spec/v1/deps"
|
||||
)
|
||||
|
||||
func updateCommand(dir, jsonnetHome string, urls ...*url.URL) int {
|
||||
|
|
@ -48,7 +48,7 @@ func updateCommand(dir, jsonnetHome string, urls ...*url.URL) int {
|
|||
writeJSONFile(filepath.Join(dir, jsonnetfile.File), jsonnetFile),
|
||||
"updating jsonnetfile.json")
|
||||
kingpin.FatalIfError(
|
||||
writeJSONFile(filepath.Join(dir, jsonnetfile.LockFile), spec.JsonnetFile{Dependencies: locked}),
|
||||
writeJSONFile(filepath.Join(dir, jsonnetfile.LockFile), v1.JsonnetFile{Dependencies: locked}),
|
||||
"updating jsonnetfile.lock.json")
|
||||
return 0
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue