forked from coop-cloud/abra
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()
|
||||
if err != nil {
|
||||
return err
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if len(tags) > 0 {
|
||||
|
@ -113,6 +113,10 @@ You may invoke this command in "wizard" mode and be prompted for input:
|
|||
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)
|
||||
|
||||
prompt := &survey.Confirm{
|
||||
|
@ -121,7 +125,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
|
|||
|
||||
var response bool
|
||||
if err := survey.AskOne(prompt, &response); err != nil {
|
||||
return err
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if !response {
|
||||
|
|
|
@ -284,7 +284,7 @@ func GetVersionLabelLocal(recipe Recipe) (string, error) {
|
|||
}
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue