Pass the working dir from main.go

This commit is contained in:
Matthias Loibl 2019-04-24 18:19:27 +02:00
parent 7560a1075c
commit c516ce2506
No known key found for this signature in database
GPG key ID: 78A796CA74CA38BA

View file

@ -86,15 +86,20 @@ func Main() int {
return 2 return 2
} }
workdir, err := os.Getwd()
if err != nil {
return 1
}
switch command { switch command {
case initCmd.FullCommand(): case initCmd.FullCommand():
return initCommand() return initCommand(workdir)
case installCmd.FullCommand(): case installCmd.FullCommand():
return installCommand(cfg.JsonnetHome, *installCmdURLs...) return installCommand(workdir, cfg.JsonnetHome, *installCmdURLs...)
case updateCmd.FullCommand(): case updateCmd.FullCommand():
return updateCommand(cfg.JsonnetHome) return updateCommand(cfg.JsonnetHome)
default: default:
installCommand(cfg.JsonnetHome) installCommand(workdir, cfg.JsonnetHome)
} }
return 0 return 0