mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 04:48:26 +08:00
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:
+1
-9
@@ -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,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)
|
||||
|
||||
Reference in New Issue
Block a user