cli: moved input dir to abs path - fixes #254
Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
parent
b12a3bf45f
commit
3e605d1d72
@ -1,6 +1,8 @@
|
||||
package input
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"dagger.io/go/cmd/dagger/logger"
|
||||
"dagger.io/go/dagger"
|
||||
"github.com/spf13/cobra"
|
||||
@ -22,7 +24,12 @@ var dirCmd = &cobra.Command{
|
||||
lg := logger.New()
|
||||
ctx := lg.WithContext(cmd.Context())
|
||||
|
||||
updateDeploymentInput(ctx, args[0], dagger.DirInput(args[1], []string{}))
|
||||
path, err := filepath.Abs(args[1])
|
||||
if err != nil {
|
||||
lg.Error().Err(err).Str("path", args[1]).Msg("cannot get absolute path")
|
||||
}
|
||||
|
||||
updateDeploymentInput(ctx, args[0], dagger.DirInput(path, []string{}))
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,12 @@ func getPlanSource(ctx context.Context) dagger.Input {
|
||||
|
||||
if planDir != "" {
|
||||
checkFirstSet()
|
||||
src = dagger.DirInput(planDir, []string{"*.cue", "cue.mod"})
|
||||
|
||||
path, err := filepath.Abs(planDir)
|
||||
if err != nil {
|
||||
lg.Error().Err(err).Str("path", planDir).Msg("cannot get absolute path")
|
||||
}
|
||||
src = dagger.DirInput(path, []string{"*.cue", "cue.mod"})
|
||||
}
|
||||
|
||||
if planGit != "" {
|
||||
|
Reference in New Issue
Block a user