Compare commits

..

3 Commits

Author SHA1 Message Date
T. von Dein
46fde289f5 fix #46: check sort array index before using it for sorting (#48) 2025-12-08 22:30:09 +01:00
d331f0b2e6 not needed 2025-12-08 22:10:06 +01:00
T. von Dein
fc0352efa9 add support for template output mode with new option --templage <tmpl> (#47) 2025-12-08 22:01:15 +01:00
2 changed files with 7 additions and 33 deletions

View File

@@ -1,32 +0,0 @@
# https://woodpecker-ci.org/plugins/docker-buildx
# enable Package unit and go to /scip/-/packages after building to link to proj
variables:
- &repo codeberg.org/${CI_REPO_OWNER}/tablizer
steps:
dryrun:
image: docker.io/woodpeckerci/plugin-docker-buildx:latest
settings:
dockerfile: Dockerfile
platforms: linux/amd64
dry_run: true
repo: *repo
tags: latest
when:
event: [pull_request]
publish:
image: docker.io/woodpeckerci/plugin-docker-buildx:latest
settings:
dockerfile: Dockerfile
platforms: linux/amd64
repo: *repo
registry: codeberg.org
tags: latest,${CI_COMMIT_SHA:0:8},${CI_COMMIT_TAG}
username: ${CI_REPO_OWNER}
password:
from_secret: REGISTRY_TOKEN
when:
event: [tag]
branch: main

View File

@@ -23,8 +23,8 @@ import (
"sort"
"strconv"
"github.com/araddon/dateparse"
"codeberg.org/scip/tablizer/cfg"
"github.com/araddon/dateparse"
)
func sortTable(conf cfg.Config, data *Tabdata) {
@@ -38,6 +38,12 @@ func sortTable(conf cfg.Config, data *Tabdata) {
return
}
for _, column := range conf.UseSortByColumn {
if column > len(data.headers) {
return
}
}
// actual sorting
sort.SliceStable(data.entries, func(i, j int) bool {
// holds the result of a sort of one column