You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/01/27 17:53:09 UTC

[GitHub] [mynewt-newt] ccollins476ad commented on a change in pull request #367: Fix clone of repos for non-[install|upgrade] cmds

ccollins476ad commented on a change in pull request #367: Fix clone of repos for non-[install|upgrade] cmds
URL: https://github.com/apache/mynewt-newt/pull/367#discussion_r371389019
 
 

 ##########
 File path: newt/project/project.go
 ##########
 @@ -499,16 +506,24 @@ func (proj *Project) verifyNewtCompat() error {
 
 // addRepo Adds an entry to the project's repo map.  It clones the repo if it
 // does not exist locally.
-func (proj *Project) addRepo(r *repo.Repo) error {
-	if err := r.EnsureExists(); err != nil {
-		return err
+func (proj *Project) addRepo(r *repo.Repo, download bool) error {
+	if download {
+		if err := r.EnsureExists(); err != nil {
+			return err
+		}
+	} else {
+		if !r.CheckExists() {
+			return util.NewNewtError(
+				fmt.Sprintf(
+					"Repo \"%s\" is not installed, please run `upgrade`!", r.Name()))
 
 Review comment:
   Do you think this should say `newt upgrade`?  I guess the `newt` part is pretty obvious.  Up to you!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services