fix: fetch recipe for "app list -S"
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
decentral1se 2025-04-19 02:05:50 +02:00 committed by decentral1se
parent fa084a61d2
commit a43a092ba7
3 changed files with 21 additions and 2 deletions

View File

@ -143,9 +143,13 @@ Use "--status/-S" flag to query all servers for the live deployment status.`,
var newUpdates []string
if version != "unknown" {
if err := app.Recipe.EnsureExists(); err != nil {
log.Fatalf("unable to clone %s: %s", app.Name, err)
}
updates, err := app.Recipe.Tags()
if err != nil {
log.Fatal(err)
log.Fatalf("unable to retrieve tags for %s: %s", app.Name, err)
}
parsedVersion, err := tagcmp.Parse(version)

View File

@ -25,7 +25,7 @@ func gitCloneIgnoreErr(err error) bool {
// Clone runs a git clone which accounts for different default branches.
func Clone(dir, url string) error {
if _, err := os.Stat(dir); os.IsNotExist(err) {
log.Debugf("git clone: %s", dir, url)
log.Debugf("git clone: %s", url)
_, err := git.PlainClone(dir, false, &git.CloneOptions{
URL: url,

View File

@ -8,6 +8,7 @@ setup_file(){
}
teardown_file(){
_undeploy_app
_rm_app
_rm_server
}
@ -98,3 +99,17 @@ teardown(){
assert_output --partial "$expectedOutput"
}
# bats test_tags=slow
@test "list with status fetches recipe" {
_deploy_app
run $ABRA app ls --status
assert_success
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE"
assert_success
run $ABRA app ls --status
assert_success
}