fix: handle missing label
This commit is contained in:
parent
6937bfbb0d
commit
e2c3bc35c3
|
@ -97,7 +97,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
|
||||||
|
|
||||||
tags, err := recipe.Tags()
|
tags, err := recipe.Tags()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
logrus.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(tags) > 0 {
|
if len(tags) > 0 {
|
||||||
|
@ -113,6 +113,10 @@ You may invoke this command in "wizard" mode and be prompted for input:
|
||||||
logrus.Fatal(err)
|
logrus.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if initTag == "" {
|
||||||
|
logrus.Fatalf("unable to read version for %s from synced label. Did you try running \"abra recipe sync %s\" already?", recipe.Name, recipe.Name)
|
||||||
|
}
|
||||||
|
|
||||||
logrus.Warnf("discovered %s as currently synced recipe label", initTag)
|
logrus.Warnf("discovered %s as currently synced recipe label", initTag)
|
||||||
|
|
||||||
prompt := &survey.Confirm{
|
prompt := &survey.Confirm{
|
||||||
|
@ -121,7 +125,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
|
||||||
|
|
||||||
var response bool
|
var response bool
|
||||||
if err := survey.AskOne(prompt, &response); err != nil {
|
if err := survey.AskOne(prompt, &response); err != nil {
|
||||||
return err
|
logrus.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !response {
|
if !response {
|
||||||
|
|
|
@ -284,7 +284,7 @@ func GetVersionLabelLocal(recipe Recipe) (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if label == "" {
|
if label == "" {
|
||||||
return label, fmt.Errorf("unable to retrieve synced version label for %s", recipe.Name)
|
return label, fmt.Errorf("%s has no version label? try running \"abra recipe sync %s\" first?", recipe.Name, recipe.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
return label, nil
|
return label, nil
|
||||||
|
|
Loading…
Reference in New Issue