From a67e0e15cb1ff73c0faf7b4f9cdcd168ffbfa423 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Sun, 21 Feb 2021 17:02:18 +0100 Subject: Strip whitespace from folder names --- pkg/config/yaml.go | 1 + pkg/config/yaml_test.go | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/pkg/config/yaml.go b/pkg/config/yaml.go index 9dd74a9..c82a57e 100644 --- a/pkg/config/yaml.go +++ b/pkg/config/yaml.go @@ -133,6 +133,7 @@ func (cfg *Config) parse(in io.Reader) error { } func appTarget(target []string, app string) []string { + app = strings.TrimSpace(app) switch { case len(target) == 0 && app == "": return []string{} diff --git a/pkg/config/yaml_test.go b/pkg/config/yaml_test.go index c8d6071..b4d5c9c 100644 --- a/pkg/config/yaml_test.go +++ b/pkg/config/yaml_test.go @@ -94,6 +94,12 @@ func TestBuildFeeds(tst *testing.T) { }, result: Feeds{"muh": &Feed{Name: "muh", Target: t("moep.foo")}}, }, + {name: "Simple With Target and Whitespace", wantErr: false, target: "moep", + feeds: []configGroupFeed{ + {Target: n("\r\nfoo "), Feed: feed{Name: "muh"}}, + }, + result: Feeds{"muh": &Feed{Name: "muh", Target: t("moep.foo")}}, + }, {name: "Simple With Target and NoAutoTarget", wantErr: false, target: "moep", noAutoTarget: true, feeds: []configGroupFeed{ {Target: n("foo"), Feed: feed{Name: "muh"}}, @@ -124,6 +130,12 @@ func TestBuildFeeds(tst *testing.T) { }, result: Feeds{"muh": &Feed{Name: "muh", Target: t("moep")}}, }, + {name: "Simple With Blank Target", wantErr: false, target: "moep", + feeds: []configGroupFeed{ + {Target: n(" "), Feed: feed{Name: "muh"}}, + }, + result: Feeds{"muh": &Feed{Name: "muh", Target: t("moep")}}, + }, {name: "Multiple Feeds", wantErr: false, target: "moep", feeds: []configGroupFeed{ {Target: n("foo"), Feed: feed{Name: "muh"}}, -- cgit v1.2.3-54-g00ecf portato.git/log/geneticone/__init__.py'>
path: root/geneticone/__init__.py (unfollow)
Commit message (Expand)AuthorFilesLines
2009-10-08Enhance the splash window handling.René 'Necoro' Neumann2-2/+9
2009-10-08Enhance the splash window handling.René 'Necoro' Neumann2-2/+9
2009-10-05Some more stuff to ignoreRené 'Necoro' Neumann1-0/+3
2009-10-05Renamed the ignore fileRené 'Necoro' Neumann1-0/+0
2009-10-05Update NEWSRené 'Necoro' Neumann1-0/+1
2009-10-05Also allow 'unselect all' in the PkgListRené 'Necoro' Neumann1-1/+10
2009-10-05Now have it the sorted way in PkgListsRené 'Necoro' Neumann2-3/+9
2009-10-05Enhanced system.sort_package_list to also sort CPVsRené 'Necoro' Neumann5-27/+38
2009-10-05Added an PkgList window and rewrote UpdateWindow and WorldListWindow to use itRené 'Necoro' Neumann3-39/+63
2009-10-05Add uninstall button and rename to PkgListWindowRené 'Necoro' Neumann1-2/+17
2009-10-05First quick hack to have a world listRené 'Necoro' Neumann3-2/+24