Improve installer updates and dependency checks and add command aliases
Release / release (push) Successful in 7m57s

This commit is contained in:
Sebastian Unterschütz committed 2026-10-27 18:10:44 +01:00
1 parent 12cc64fdd9
commit 4b28d441b0
13 files changed
+973 -148

No files matched your search

+19
View File
@@ -6,6 +6,8 @@ import (
"strings"
"testing"
"git.zb-server.de/Sebi/ssh-netbox-wrapper/internal/cache"
"git.zb-server.de/Sebi/ssh-netbox-wrapper/internal/config"
"git.zb-server.de/Sebi/ssh-netbox-wrapper/internal/hook"
)
@@ -208,3 +210,20 @@ func TestUninstall_AlsoRemovesAliasesSourceLine(t *testing.T) {
t.Error("other content should be preserved")
}
}
func TestCommandAliasGenerationAndCollision(t *testing.T) {
cfg := config.Config{Shell: config.ShellConfig{Alias: "j"}}
entries := hook.BuildAliasEntries([]cache.Entry{{Name: "j"}, {Name: "netssh"}, {Name: "web-01"}}, cfg)
if len(entries) != 2 {
t.Fatalf("entries: %+v", entries)
}
if got := entries[0].Definition("bash"); got != "alias j='netssh'" {
t.Fatal(got)
}
if got := entries[0].Definition("fish"); got != "alias j 'netssh'" {
t.Fatal(got)
}
if got := entries[1].Definition("bash"); got != "alias web-01='netssh web-01'" {
t.Fatal(got)
}
}