only consider workspaces containing an env directory
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
f374f4c5ea
commit
0acd3a256a
@ -40,6 +40,9 @@ func Init(ctx context.Context, dir string) (*Workspace, error) {
|
|||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if err := os.Mkdir(path.Join(root, envDir), 0755); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
return &Workspace{
|
return &Workspace{
|
||||||
Path: root,
|
Path: root,
|
||||||
}, nil
|
}, nil
|
||||||
@ -72,7 +75,7 @@ func Current(ctx context.Context) (*Workspace, error) {
|
|||||||
|
|
||||||
// Walk every parent directory to find .dagger
|
// Walk every parent directory to find .dagger
|
||||||
for {
|
for {
|
||||||
_, err := os.Stat(path.Join(current, daggerDir))
|
_, err := os.Stat(path.Join(current, daggerDir, envDir))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return Open(ctx, current)
|
return Open(ctx, current)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user