MYNEWT-126
newt new command broke because we were not heeding the error from these functions.
diff --git a/newt/cli/complete_cmd.go b/newt/cli/complete_cmd.go
index dd113da..c01410c 100644
--- a/newt/cli/complete_cmd.go
+++ b/newt/cli/complete_cmd.go
@@ -34,8 +34,14 @@
)
func targetList() []string {
- _ = project.Initialize()
+ err := project.Initialize()
+
targetNames := []string{}
+
+ if err != nil {
+ return targetNames
+ }
+
for name, _ := range target.GetTargets() {
// Don't display the special unittest target; this is used
// internally by newt, so the user doesn't need to know about it.
@@ -50,7 +56,14 @@
/* return a list of all packages */
func packageList() []string {
+
+ err := project.Initialize()
+
var list []string
+
+ if err != nil {
+ return list
+ }
for _, repoHash := range project.GetProject().PackageList() {
for _, pack := range *repoHash {
lclPack := pack.(*pkg.LocalPackage)