// TestCCCInitConfig tests the Init function
func TestCCCInitConfig(t *testing.T) {
	tmpHome, savedHome := createCCCTmpHome(t)
	defer os.RemoveAll(tmpHome)
	defer os.Setenv("HOME", savedHome)

	var conf cutils.UpdateClientConfig
	err := conf.Init()
	assert.Nil(t, err, "Fail to init config")
}
Esempio n. 2
0
		removeCommand,
		listCommand,
		pushCommand,
		pullCommand,
		deleteCommand,
		decryptCommand,
	},
}

var initCommand = cli.Command{
	Name:  "init",
	Usage: "initiate default setting",
	Action: func(context *cli.Context) error {
		var ucc cutils.UpdateClientConfig

		if err := ucc.Init(); err != nil {
			fmt.Println(err)
			return err
		}

		fmt.Println("Success in initiating Dockyard Updater Client configuration.")
		return nil
	},
}

var addCommand = cli.Command{
	Name:  "add",
	Usage: "add a repository url",

	Action: func(context *cli.Context) error {
		var ucc cutils.UpdateClientConfig