fixes issue where dagger hands when input directory does not exist
Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
10
plan/plan.go
10
plan/plan.go
@@ -2,7 +2,10 @@ package plan
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -69,6 +72,13 @@ func (p *Plan) registerLocalDirs() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
abs, err := filepath.Abs(dir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := os.Stat(abs); errors.Is(err, os.ErrNotExist) {
|
||||
return fmt.Errorf("path %q does not exist", abs)
|
||||
}
|
||||
p.context.LocalDirs.Add(dir)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user