mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2026-02-02 17:35:09 +01:00
Extract cmd/jb/init.go
This commit is contained in:
parent
5fdb88b6f0
commit
7560a1075c
2 changed files with 32 additions and 20 deletions
|
|
@ -100,26 +100,6 @@ func Main() int {
|
|||
return 0
|
||||
}
|
||||
|
||||
func initCommand() int {
|
||||
exists, err := pkg.FileExists(pkg.JsonnetFile)
|
||||
if err != nil {
|
||||
kingpin.Errorf("Failed to check for jsonnetfile.json: %v", err)
|
||||
return 1
|
||||
}
|
||||
|
||||
if exists {
|
||||
kingpin.Errorf("jsonnetfile.json already exists")
|
||||
return 1
|
||||
}
|
||||
|
||||
if err := ioutil.WriteFile(pkg.JsonnetFile, []byte("{}\n"), 0644); err != nil {
|
||||
kingpin.Errorf("Failed to write new jsonnetfile.json: %v", err)
|
||||
return 1
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
func parseDepedency(urlString string) *spec.Dependency {
|
||||
if spec := parseGitSSHDependency(urlString); spec != nil {
|
||||
return spec
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue