cli: move client-only code out of the server flow

earlier, some of the client exclusive code was being run on zot server
instance too.

cli: fix the bug: spinner is not stopped with -o
This commit is contained in:
Tanmay Naik
2020-07-14 13:11:01 -04:00
parent e639b4814e
commit bb9fbd2ef9
9 changed files with 86 additions and 73 deletions
+1 -9
View File
@@ -2,20 +2,12 @@ package main
import (
"os"
"path"
"github.com/anuvu/zot/pkg/cli"
)
func main() {
home, err := os.UserHomeDir()
if err != nil {
panic(err)
}
configPath := path.Join(home + "/.zot")
if err := cli.NewRootCmd(configPath).Execute(); err != nil {
if err := cli.NewRootCmd().Execute(); err != nil {
os.Exit(1)
}
}
+1 -3
View File
@@ -1,7 +1,6 @@
package main_test
import (
"io/ioutil"
"testing"
"github.com/anuvu/zot/pkg/api"
@@ -15,8 +14,7 @@ func TestIntegration(t *testing.T) {
c := api.NewController(config)
So(c, ShouldNotBeNil)
tempFile, _ := ioutil.TempFile("", "tmp-")
cl := cli.NewRootCmd(tempFile.Name())
cl := cli.NewRootCmd()
So(cl, ShouldNotBeNil)
So(cl.Execute(), ShouldBeNil)