Skip to content

Commit

Permalink
only consider workspaces containing an env directory
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
  • Loading branch information
aluzzardi committed May 25, 2021
1 parent f374f4c commit 0acd3a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dagger/state/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ func Init(ctx context.Context, dir string) (*Workspace, error) {
}
return nil, err
}
if err := os.Mkdir(path.Join(root, envDir), 0755); err != nil {
return nil, err
}
return &Workspace{
Path: root,
}, nil
Expand Down Expand Up @@ -72,7 +75,7 @@ func Current(ctx context.Context) (*Workspace, error) {

// Walk every parent directory to find .dagger
for {
_, err := os.Stat(path.Join(current, daggerDir))
_, err := os.Stat(path.Join(current, daggerDir, envDir))
if err == nil {
return Open(ctx, current)
}
Expand Down

0 comments on commit 0acd3a2

Please sign in to comment.