예제 #1
0
func upgradeRunCmd(cmd *cobra.Command, args []string) {
	proj := InitProject()
	interfaces.SetProject(proj)

	if err := proj.Upgrade(projectForce); err != nil {
		NewtUsage(cmd, err)
	}
}
예제 #2
0
func installRunCmd(cmd *cobra.Command, args []string) {
	proj := InitProject()
	interfaces.SetProject(proj)

	if err := proj.Install(false, projectForce); err != nil {
		NewtUsage(cmd, err)
	}
}
예제 #3
0
func (proj *Project) Init(dir string) error {
	proj.BasePath = dir

	// Only one project per system, when created, set it as the global project
	interfaces.SetProject(proj)

	proj.repos = map[string]*repo.Repo{}

	// Load Project configuration
	if err := proj.loadConfig(); err != nil {
		return err
	}

	return nil
}