From a3b84386bc99f62d3cb6deb2b292b2fa634a0307 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Thu, 25 Mar 2021 15:50:19 -0700 Subject: [PATCH] store routes as directories Signed-off-by: Andrea Luzzardi --- dagger/store.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dagger/store.go b/dagger/store.go index 2eab5963..9c4a88bf 100644 --- a/dagger/store.go +++ b/dagger/store.go @@ -6,7 +6,6 @@ import ( "errors" "os" "path" - "path/filepath" "github.com/google/uuid" ) @@ -95,18 +94,16 @@ func (s *Store) ListRoutes(ctx context.Context) ([]string, error) { } for _, f := range files { - if f.IsDir() || filepath.Ext(f.Name()) != ".json" { - // There is extra data in the directory, ignore - continue + if f.IsDir() { + routes = append(routes, f.Name()) } - routes = append(routes, f.Name()[:len(f.Name())-5]) } return routes, nil } func (s *Store) routePath(name string) string { - return path.Join(s.root, name+".json") + return path.Join(s.root, name, "route.json") } func (s *Store) syncRoute(r *Route) error {