You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by "michal-narajowski (via GitHub)" <gi...@apache.org> on 2023/01/26 08:36:51 UTC

[GitHub] [mynewt-newt] michal-narajowski commented on a diff in pull request #497: Allow to download external repos without project.yml file

michal-narajowski commented on code in PR #497:
URL: https://github.com/apache/mynewt-newt/pull/497#discussion_r1087547963


##########
newt/repo/repo.go:
##########
@@ -194,6 +194,18 @@ func (r *Repo) patchesFilePath() string {
 		"/.patches/"
 }
 
+// Checks for repository.yml file presence in specified repo folder.
+// If there is no such file, the repo in specified folder is external.
+func (r *Repo) IsExternal(dir string) bool {
+	path := dir + "/repository.yml"
+	_, err := os.Stat(path)
+	if os.IsNotExist(err) {
+		return true
+	} else {
+		return false
+	}

Review Comment:
   ```suggestion
   	return os.IsNotExist(err)
   ```



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org