fix: abra app ls TUI max height and speed optimisation #690

Merged
decentral1se merged 3 commits from fix/689 into main 2025-10-03 18:39:50 +00:00
7 changed files with 103 additions and 119 deletions

View File

@ -512,7 +512,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.table = msg.table
m.table = m.table.WithTargetWidth(m.width)
m.table = m.table.WithPageSize(m.height - 10)
m.table = m.table.WithPageSize(calculateHeight(m))
if m.initStatusGather {
m.pollingStatus = true
@ -526,7 +526,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.height = msg.Height
m.table = m.table.WithTargetWidth(m.width)
m.table = m.table.WithPageSize(m.height - 10)
m.table = m.table.WithPageSize(calculateHeight(m))
case errorMsg:
m.err = msg
}
@ -540,6 +540,10 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, tea.Batch(cmds...)
}
func calculateHeight(m model) int {
return m.height/2 - 5
}
func (m model) View() string {
if m.err != nil {
return fmt.Sprintf("FATA: %v", m.err)
@ -554,7 +558,7 @@ func (m model) View() string {
m.numFilteredServers, m.numFilteredApps, m.numFilteredRecipes,
)
help := "[q] quit • [/] filter • [s] status"
help := "[q] quit • [/] filter • [s] status • [ctrl+u/d] page up/down"
body.WriteString(lipgloss.JoinHorizontal(lipgloss.Center, stats, " | ", help))

View File

@ -644,6 +644,9 @@ func (a App) WriteRecipeVersion(version string, dryRun bool) error {
scanner = bufio.NewScanner(file)
)
// NOTE(d1): don't care at this point if there is a git failure
isDirty, _ := a.Recipe.IsDirty()
for scanner.Scan() {
line := scanner.Text()
if !strings.HasPrefix(line, "RECIPE=") && !strings.HasPrefix(line, "TYPE=") {
@ -656,7 +659,7 @@ func (a App) WriteRecipeVersion(version string, dryRun bool) error {
continue
}
if strings.Contains(line, version) && !a.Recipe.Dirty && !strings.HasSuffix(line, config.DIRTY_DEFAULT) {
if strings.Contains(line, version) && !isDirty && !strings.HasSuffix(line, config.DIRTY_DEFAULT) {
skipped = true
lines = append(lines, line)
continue
@ -669,16 +672,16 @@ func (a App) WriteRecipeVersion(version string, dryRun bool) error {
}
if err := scanner.Err(); err != nil {
log.Fatal(err)
return err
}
if a.Recipe.Dirty && dirtyVersion != "" {
if isDirty && dirtyVersion != "" {
version = dirtyVersion
}
if !dryRun {
if err := os.WriteFile(a.Path, []byte(strings.Join(lines, "\n")), os.ModePerm); err != nil {
log.Fatal(err)
return err
}
} else {
log.Debug(i18n.G("skipping writing version %s because dry run", version))

View File

@ -7,7 +7,7 @@
msgid ""
msgstr "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2025-10-02 10:54+0200\n"
"POT-Creation-Date: 2025-10-03 20:35+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -411,7 +411,7 @@ msgstr ""
msgid "%s sanitised as %s for new app"
msgstr ""
#: ./pkg/recipe/git.go:434
#: ./pkg/recipe/git.go:435
#, c-format
msgid "%s service is missing image tag?"
msgstr ""
@ -481,12 +481,12 @@ msgstr ""
msgid "%s: ? (missing version)"
msgstr ""
#: ./pkg/recipe/recipe.go:237
#: ./pkg/recipe/recipe.go:228
#, c-format
msgid "%s: attempt recipe metadata parse"
msgstr ""
#: ./pkg/recipe/recipe.go:368
#: ./pkg/recipe/recipe.go:359
#, c-format
msgid "%s: end marker %s not found"
msgstr ""
@ -501,17 +501,17 @@ msgstr ""
msgid "%s: ignoring unsupported options: %s"
msgstr ""
#: ./pkg/recipe/recipe.go:325
#: ./pkg/recipe/recipe.go:316
#, c-format
msgid "%s: image meta has incorrect format: %s"
msgstr ""
#: ./pkg/recipe/recipe.go:330
#: ./pkg/recipe/recipe.go:321
#, c-format
msgid "%s: image meta is empty?"
msgstr ""
#: ./pkg/recipe/recipe.go:361
#: ./pkg/recipe/recipe.go:352
#, c-format
msgid "%s: marker string %s not found"
msgstr ""
@ -1740,7 +1740,7 @@ msgstr ""
msgid "abra version: %s, commit: %s, lang: %s"
msgstr ""
#: ./pkg/recipe/recipe.go:208
#: ./pkg/recipe/recipe.go:199
#, c-format
msgid "abra.sh: %s}"
msgstr ""
@ -2107,7 +2107,7 @@ msgstr ""
msgid "chk"
msgstr ""
#: ./pkg/recipe/recipe.go:74
#: ./pkg/recipe/recipe.go:73
#, c-format
msgid "choosing %s as latest version of %s"
msgstr ""
@ -2142,7 +2142,7 @@ msgstr ""
msgid "cmd"
msgstr ""
#: ./pkg/recipe/git.go:458
#: ./pkg/recipe/git.go:459
#, c-format
msgid "collected %s for %s"
msgstr ""
@ -2156,7 +2156,7 @@ msgstr ""
msgid "collecting metadata from %v servers: %s"
msgstr ""
#: ./pkg/recipe/recipe.go:549
#: ./pkg/recipe/recipe.go:540
msgid "collecting recipe listing"
msgstr ""
@ -2203,7 +2203,7 @@ msgstr ""
msgid "compose file contains unsupported options: %s"
msgstr ""
#: ./pkg/recipe/recipe.go:205
#: ./pkg/recipe/recipe.go:196
#, c-format
msgid "compose: %s, "
msgstr ""
@ -2468,7 +2468,7 @@ msgstr ""
msgid "destination directory does not exist"
msgstr ""
#: ./pkg/recipe/git.go:367
#: ./pkg/recipe/git.go:368
#, c-format
msgid "detected %s as tags for recipe %s"
msgstr ""
@ -2487,7 +2487,7 @@ msgstr ""
msgid "detected potential upgradable tags %s for %s"
msgstr ""
#: ./pkg/recipe/recipe.go:435
#: ./pkg/recipe/recipe.go:426
#, c-format
msgid "detected versions %s for %s"
msgstr ""
@ -2521,7 +2521,7 @@ msgstr ""
msgid "different versions for secret '%s', '%s' and %s'"
msgstr ""
#: ./pkg/recipe/recipe.go:202
#: ./pkg/recipe/recipe.go:193
#, c-format
msgid "dir: %s, "
msgstr ""
@ -2531,11 +2531,6 @@ msgstr ""
msgid "directory is empty: %s"
msgstr ""
#: ./pkg/recipe/recipe.go:201
#, c-format
msgid "dirty: %v, "
msgstr ""
#: ./cli/app/deploy.go:420 ./cli/app/rollback.go:368 ./cli/app/upgrade.go:478
msgid "disable converge logic checks"
msgstr ""
@ -2787,12 +2782,7 @@ msgstr ""
msgid "failed to add release notes: %s"
msgstr ""
#: ./pkg/recipe/recipe.go:175
#, c-format
msgid "failed to check git status of %s: %s"
msgstr ""
#: ./pkg/git/branch.go:95 ./pkg/recipe/git.go:225 ./pkg/recipe/git.go:406
#: ./pkg/git/branch.go:95 ./pkg/recipe/git.go:225 ./pkg/recipe/git.go:407
#, c-format
msgid "failed to check out %s in %s"
msgstr ""
@ -2987,7 +2977,7 @@ msgstr ""
msgid "fetching latest recipes..."
msgstr ""
#: ./pkg/recipe/recipe.go:555
#: ./pkg/recipe/recipe.go:546
#, c-format
msgid "fetching repo metadata from %s"
msgstr ""
@ -3096,7 +3086,7 @@ msgstr ""
msgid "git changes pushed"
msgstr ""
#: ./pkg/recipe/git.go:410
#: ./pkg/recipe/git.go:411
#, c-format
msgid "git checkout: %s in %s"
msgstr ""
@ -3154,7 +3144,7 @@ msgstr ""
msgid "git tags pushed"
msgstr ""
#: ./pkg/recipe/recipe.go:203
#: ./pkg/recipe/recipe.go:194
#, c-format
msgid "git url: %s, "
msgstr ""
@ -3176,7 +3166,7 @@ msgstr ""
msgid "git.coopcloud.tech repo exists"
msgstr ""
#: ./pkg/recipe/git.go:378
#: ./pkg/recipe/git.go:379
#, c-format
msgid "git: opening repository in %s"
msgstr ""
@ -3393,7 +3383,7 @@ msgstr ""
msgid "invalid option %s for flag --resolve-image"
msgstr ""
#: ./pkg/recipe/recipe.go:147
#: ./pkg/recipe/recipe.go:146
#, c-format
msgid "invalid recipe: %s"
msgstr ""
@ -4086,7 +4076,7 @@ msgstr ""
msgid "proceed?"
msgstr ""
#: ./pkg/recipe/git.go:398
#: ./pkg/recipe/git.go:399
#, c-format
msgid "processing %s for %s"
msgstr ""
@ -4181,7 +4171,7 @@ msgstr ""
msgid "read global ignore paths: %s"
msgstr ""
#: ./pkg/recipe/recipe.go:406
#: ./pkg/recipe/recipe.go:397
#, c-format
msgid "read recipe catalogue from file system cache in %s"
msgstr ""
@ -4210,7 +4200,7 @@ msgstr ""
msgid "reading secret from file: %s"
msgstr ""
#: ./pkg/recipe/recipe.go:206
#: ./pkg/recipe/recipe.go:197
#, c-format
msgid "readme: %s, "
msgstr ""
@ -4220,7 +4210,7 @@ msgstr ""
msgid "recipe"
msgstr ""
#: ./pkg/recipe/recipe.go:458
#: ./pkg/recipe/recipe.go:449
#, c-format
msgid "recipe %s does not exist?"
msgstr ""
@ -4236,7 +4226,7 @@ msgstr ""
msgid "recipe [cmd] [args] [flags]"
msgstr ""
#: ./pkg/recipe/recipe.go:462
#: ./pkg/recipe/recipe.go:453
#, c-format
msgid "recipe metadata retrieved for %s"
msgstr ""
@ -4309,7 +4299,7 @@ msgstr ""
msgid "removed .git repo in %s"
msgstr ""
#: ./pkg/recipe/recipe.go:138
#: ./pkg/recipe/recipe.go:137
#, c-format
msgid "removed dirty suffix from .env version: %s -> %s"
msgstr ""
@ -4490,7 +4480,7 @@ msgstr ""
msgid "retrieving docker auth token: failed create docker cli: %s"
msgstr ""
#: ./pkg/recipe/recipe.go:659
#: ./pkg/recipe/recipe.go:650
msgid "retrieving recipes"
msgstr ""
@ -4605,7 +4595,7 @@ msgstr ""
msgid "s"
msgstr ""
#: ./pkg/recipe/recipe.go:207
#: ./pkg/recipe/recipe.go:198
#, c-format
msgid "sample env: %s, "
msgstr ""
@ -4858,12 +4848,12 @@ msgstr ""
msgid "skipping generation of %s (generate=false)"
msgstr ""
#: ./pkg/app/app.go:690
#: ./pkg/app/app.go:693
#, c-format
msgid "skipping version %s write as already exists in %s.env"
msgstr ""
#: ./pkg/app/app.go:684
#: ./pkg/app/app.go:687
#, c-format
msgid "skipping writing version %s because dry run"
msgstr ""
@ -4913,7 +4903,7 @@ msgstr ""
msgid "ssh host connection is not valid"
msgstr ""
#: ./pkg/recipe/recipe.go:204
#: ./pkg/recipe/recipe.go:195
#, c-format
msgid "ssh url: %s, "
msgstr ""
@ -5574,7 +5564,7 @@ msgstr ""
msgid "version"
msgstr ""
#: ./pkg/app/app.go:688
#: ./pkg/app/app.go:691
#, c-format
msgid "version %s saved to %s.env"
msgstr ""
@ -5584,7 +5574,7 @@ msgstr ""
msgid "version '%s' appears to be a chaos commit, but --chaos/-C was not provided"
msgstr ""
#: ./pkg/recipe/recipe.go:200
#: ./pkg/recipe/recipe.go:192
#, c-format
msgid "version : %s, "
msgstr ""
@ -5593,7 +5583,7 @@ msgstr ""
msgid "version for abra"
msgstr ""
#: ./pkg/recipe/recipe.go:130
#: ./pkg/recipe/recipe.go:129
#, c-format
msgid "version seems invalid: %s"
msgstr ""
@ -5780,7 +5770,7 @@ msgstr ""
msgid "{decoder: %v, "
msgstr ""
#: ./pkg/recipe/recipe.go:199
#: ./pkg/recipe/recipe.go:191
#, c-format
msgid "{name: %s, "
msgstr ""

View File

@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: EMAIL\n"
"POT-Creation-Date: 2025-10-02 10:54+0200\n"
"POT-Creation-Date: 2025-10-03 20:35+0200\n"
"PO-Revision-Date: 2025-09-04 08:14+0000\n"
"Last-Translator: chasqui <chasqui@cryptolab.net>\n"
"Language-Team: Spanish <https://translate.coopcloud.tech/projects/co-op-"
@ -428,7 +428,7 @@ msgstr ""
msgid "%s sanitised as %s for new app"
msgstr ""
#: pkg/recipe/git.go:434
#: pkg/recipe/git.go:435
#, c-format
msgid "%s service is missing image tag?"
msgstr ""
@ -498,12 +498,12 @@ msgstr ""
msgid "%s: ? (missing version)"
msgstr ""
#: pkg/recipe/recipe.go:237
#: pkg/recipe/recipe.go:228
#, c-format
msgid "%s: attempt recipe metadata parse"
msgstr ""
#: pkg/recipe/recipe.go:368
#: pkg/recipe/recipe.go:359
#, c-format
msgid "%s: end marker %s not found"
msgstr ""
@ -518,17 +518,17 @@ msgstr ""
msgid "%s: ignoring unsupported options: %s"
msgstr ""
#: pkg/recipe/recipe.go:325
#: pkg/recipe/recipe.go:316
#, c-format
msgid "%s: image meta has incorrect format: %s"
msgstr ""
#: pkg/recipe/recipe.go:330
#: pkg/recipe/recipe.go:321
#, c-format
msgid "%s: image meta is empty?"
msgstr ""
#: pkg/recipe/recipe.go:361
#: pkg/recipe/recipe.go:352
#, c-format
msgid "%s: marker string %s not found"
msgstr ""
@ -1702,19 +1702,19 @@ msgid ""
"\n"
"Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "
"\"help\"))}}\n"
" {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}"
"{{if .HasAvailableLocalFlags}}\n"
" {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if ."
"HasAvailableLocalFlags}}\n"
"\n"
"Flags:\n"
"{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}"
"{{if .HasAvailableInheritedFlags}}\n"
"{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if ."
"HasAvailableInheritedFlags}}\n"
"\n"
"Global Flags:\n"
"{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}"
"{{if .HasHelpSubCommands}}\n"
"{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if ."
"HasHelpSubCommands}}\n"
"\n"
"Additional help topics:{{range .Commands}}"
"{{if .IsAdditionalHelpTopicCommand}}\n"
"Additional help topics:{{range .Commands}}{{if ."
"IsAdditionalHelpTopicCommand}}\n"
" {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}"
"{{if .HasAvailableSubCommands}}\n"
"\n"
@ -1902,7 +1902,7 @@ msgstr ""
msgid "abra version: %s, commit: %s, lang: %s"
msgstr ""
#: pkg/recipe/recipe.go:208
#: pkg/recipe/recipe.go:199
#, c-format
msgid "abra.sh: %s}"
msgstr ""
@ -2287,7 +2287,7 @@ msgstr ""
msgid "chk"
msgstr ""
#: pkg/recipe/recipe.go:74
#: pkg/recipe/recipe.go:73
#, c-format
msgid "choosing %s as latest version of %s"
msgstr ""
@ -2322,7 +2322,7 @@ msgstr ""
msgid "cmd"
msgstr ""
#: pkg/recipe/git.go:458
#: pkg/recipe/git.go:459
#, c-format
msgid "collected %s for %s"
msgstr ""
@ -2336,7 +2336,7 @@ msgstr ""
msgid "collecting metadata from %v servers: %s"
msgstr ""
#: pkg/recipe/recipe.go:549
#: pkg/recipe/recipe.go:540
msgid "collecting recipe listing"
msgstr ""
@ -2389,7 +2389,7 @@ msgstr ""
msgid "compose file contains unsupported options: %s"
msgstr ""
#: pkg/recipe/recipe.go:205
#: pkg/recipe/recipe.go:196
#, c-format
msgid "compose: %s, "
msgstr ""
@ -2656,7 +2656,7 @@ msgstr ""
msgid "destination directory does not exist"
msgstr ""
#: pkg/recipe/git.go:367
#: pkg/recipe/git.go:368
#, c-format
msgid "detected %s as tags for recipe %s"
msgstr ""
@ -2675,7 +2675,7 @@ msgstr ""
msgid "detected potential upgradable tags %s for %s"
msgstr ""
#: pkg/recipe/recipe.go:435
#: pkg/recipe/recipe.go:426
#, c-format
msgid "detected versions %s for %s"
msgstr ""
@ -2709,7 +2709,7 @@ msgstr ""
msgid "different versions for secret '%s', '%s' and %s'"
msgstr ""
#: pkg/recipe/recipe.go:202
#: pkg/recipe/recipe.go:193
#, c-format
msgid "dir: %s, "
msgstr ""
@ -2719,11 +2719,6 @@ msgstr ""
msgid "directory is empty: %s"
msgstr ""
#: pkg/recipe/recipe.go:201
#, c-format
msgid "dirty: %v, "
msgstr ""
#: cli/app/deploy.go:420 cli/app/rollback.go:368 cli/app/upgrade.go:478
msgid "disable converge logic checks"
msgstr ""
@ -2984,12 +2979,7 @@ msgstr ""
msgid "failed to add release notes: %s"
msgstr ""
#: pkg/recipe/recipe.go:175
#, c-format
msgid "failed to check git status of %s: %s"
msgstr ""
#: pkg/git/branch.go:95 pkg/recipe/git.go:225 pkg/recipe/git.go:406
#: pkg/git/branch.go:95 pkg/recipe/git.go:225 pkg/recipe/git.go:407
#, c-format
msgid "failed to check out %s in %s"
msgstr ""
@ -3184,7 +3174,7 @@ msgstr ""
msgid "fetching latest recipes..."
msgstr ""
#: pkg/recipe/recipe.go:555
#: pkg/recipe/recipe.go:546
#, c-format
msgid "fetching repo metadata from %s"
msgstr ""
@ -3294,7 +3284,7 @@ msgstr ""
msgid "git changes pushed"
msgstr ""
#: pkg/recipe/git.go:410
#: pkg/recipe/git.go:411
#, c-format
msgid "git checkout: %s in %s"
msgstr ""
@ -3352,7 +3342,7 @@ msgstr ""
msgid "git tags pushed"
msgstr ""
#: pkg/recipe/recipe.go:203
#: pkg/recipe/recipe.go:194
#, c-format
msgid "git url: %s, "
msgstr ""
@ -3374,7 +3364,7 @@ msgstr ""
msgid "git.coopcloud.tech repo exists"
msgstr ""
#: pkg/recipe/git.go:378
#: pkg/recipe/git.go:379
#, c-format
msgid "git: opening repository in %s"
msgstr ""
@ -3600,7 +3590,7 @@ msgstr ""
msgid "invalid option %s for flag --resolve-image"
msgstr ""
#: pkg/recipe/recipe.go:147
#: pkg/recipe/recipe.go:146
#, c-format
msgid "invalid recipe: %s"
msgstr ""
@ -4327,7 +4317,7 @@ msgstr ""
msgid "proceed?"
msgstr ""
#: pkg/recipe/git.go:398
#: pkg/recipe/git.go:399
#, c-format
msgid "processing %s for %s"
msgstr ""
@ -4425,7 +4415,7 @@ msgstr ""
msgid "read global ignore paths: %s"
msgstr ""
#: pkg/recipe/recipe.go:406
#: pkg/recipe/recipe.go:397
#, c-format
msgid "read recipe catalogue from file system cache in %s"
msgstr ""
@ -4454,7 +4444,7 @@ msgstr ""
msgid "reading secret from file: %s"
msgstr ""
#: pkg/recipe/recipe.go:206
#: pkg/recipe/recipe.go:197
#, c-format
msgid "readme: %s, "
msgstr ""
@ -4464,7 +4454,7 @@ msgstr ""
msgid "recipe"
msgstr ""
#: pkg/recipe/recipe.go:458
#: pkg/recipe/recipe.go:449
#, c-format
msgid "recipe %s does not exist?"
msgstr ""
@ -4481,7 +4471,7 @@ msgstr ""
msgid "recipe [cmd] [args] [flags]"
msgstr "receta [cmd] [args] [flags]"
#: pkg/recipe/recipe.go:462
#: pkg/recipe/recipe.go:453
#, c-format
msgid "recipe metadata retrieved for %s"
msgstr ""
@ -4554,7 +4544,7 @@ msgstr ""
msgid "removed .git repo in %s"
msgstr ""
#: pkg/recipe/recipe.go:138
#: pkg/recipe/recipe.go:137
#, c-format
msgid "removed dirty suffix from .env version: %s -> %s"
msgstr ""
@ -4736,7 +4726,7 @@ msgstr ""
msgid "retrieving docker auth token: failed create docker cli: %s"
msgstr ""
#: pkg/recipe/recipe.go:659
#: pkg/recipe/recipe.go:650
msgid "retrieving recipes"
msgstr ""
@ -4856,7 +4846,7 @@ msgstr ""
msgid "s"
msgstr ""
#: pkg/recipe/recipe.go:207
#: pkg/recipe/recipe.go:198
#, c-format
msgid "sample env: %s, "
msgstr ""
@ -4971,8 +4961,8 @@ msgstr ""
#: cli/recipe/upgrade.go:228
#, c-format
msgid ""
"service %s is at version %s, but pinned to %s, please correct your "
"compose.yml file manually!"
"service %s is at version %s, but pinned to %s, please correct your compose."
"yml file manually!"
msgstr ""
#: cli/recipe/upgrade.go:224
@ -5112,12 +5102,12 @@ msgstr ""
msgid "skipping generation of %s (generate=false)"
msgstr ""
#: pkg/app/app.go:690
#: pkg/app/app.go:693
#, c-format
msgid "skipping version %s write as already exists in %s.env"
msgstr ""
#: pkg/app/app.go:684
#: pkg/app/app.go:687
#, c-format
msgid "skipping writing version %s because dry run"
msgstr ""
@ -5167,7 +5157,7 @@ msgstr ""
msgid "ssh host connection is not valid"
msgstr ""
#: pkg/recipe/recipe.go:204
#: pkg/recipe/recipe.go:195
#, c-format
msgid "ssh url: %s, "
msgstr ""
@ -5841,7 +5831,7 @@ msgstr ""
msgid "version"
msgstr ""
#: pkg/app/app.go:688
#: pkg/app/app.go:691
#, c-format
msgid "version %s saved to %s.env"
msgstr ""
@ -5852,7 +5842,7 @@ msgid ""
"version '%s' appears to be a chaos commit, but --chaos/-C was not provided"
msgstr ""
#: pkg/recipe/recipe.go:200
#: pkg/recipe/recipe.go:192
#, c-format
msgid "version : %s, "
msgstr ""
@ -5861,7 +5851,7 @@ msgstr ""
msgid "version for abra"
msgstr ""
#: pkg/recipe/recipe.go:130
#: pkg/recipe/recipe.go:129
#, c-format
msgid "version seems invalid: %s"
msgstr ""
@ -6052,7 +6042,7 @@ msgstr ""
msgid "{decoder: %v, "
msgstr ""
#: pkg/recipe/recipe.go:199
#: pkg/recipe/recipe.go:191
#, c-format
msgid "{name: %s, "
msgstr ""

View File

@ -305,6 +305,7 @@ func (r *Recipe) ChaosVersion() (string, error) {
if err != nil {
return "", err
}
if dirty {
return fmt.Sprintf("%s%s", version, config.DIRTY_DEFAULT), nil
}

View File

@ -15,7 +15,12 @@ func TestIsDirty(t *testing.T) {
t.Fatal(err)
}
assert.False(t, r.Dirty)
isDirty, err := r.IsDirty()
if err != nil {
t.Fatal(err)
}
assert.False(t, isDirty)
fpath := filepath.Join(r.Dir, "foo.txt")
f, err := os.Create(fpath)

View File

@ -13,7 +13,6 @@ import (
"strings"
"coopcloud.tech/abra/pkg/i18n"
"github.com/go-git/go-git/v5"
"coopcloud.tech/abra/pkg/catalogue"
"coopcloud.tech/abra/pkg/config"
@ -170,12 +169,6 @@ func Get(name string) Recipe {
AbraShPath: path.Join(dir, "abra.sh"),
}
dirty, err := r.IsDirty()
if err != nil && !errors.Is(err, git.ErrRepositoryNotExists) {
log.Fatal(i18n.G("failed to check git status of %s: %s", r.Name, err))
}
r.Dirty = dirty
return r
}
@ -183,7 +176,6 @@ type Recipe struct {
Name string
EnvVersion string
EnvVersionRaw string
Dirty bool // NOTE(d1): git terminology for unstaged changes
Dir string
GitURL string
SSHURL string
@ -198,7 +190,6 @@ type Recipe struct {
func (r Recipe) String() string {
out := i18n.G("{name: %s, ", r.Name)
out += i18n.G("version : %s, ", r.EnvVersion)
out += i18n.G("dirty: %v, ", r.Dirty)
out += i18n.G("dir: %s, ", r.Dir)
out += i18n.G("git url: %s, ", r.GitURL)
out += i18n.G("ssh url: %s, ", r.SSHURL)