store: fix root directory

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2021-04-01 22:16:29 -07:00
parent 896d303f4a
commit d848afe7a9

View File

@ -46,13 +46,13 @@ func NewStore(root string) (*Store, error) {
} }
func DefaultStore() (*Store, error) { func DefaultStore() (*Store, error) {
root := defaultStoreRoot if root := os.Getenv("DAGGER_STORE"); root != "" {
if r := os.Getenv("DAGGER_STORE"); r != "" {
root = r
}
return NewStore(root) return NewStore(root)
} }
return NewStore(os.ExpandEnv(defaultStoreRoot))
}
func (s *Store) deploymentPath(name string) string { func (s *Store) deploymentPath(name string) string {
return path.Join(s.root, name, "deployment.json") return path.Join(s.root, name, "deployment.json")
} }