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
|
package input
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
"dagger.io/go/cmd/dagger/logger"
|
"dagger.io/go/cmd/dagger/logger"
|
||||||
"dagger.io/go/dagger"
|
"dagger.io/go/dagger"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@ -22,7 +24,12 @@ var dirCmd = &cobra.Command{
|
|||||||
lg := logger.New()
|
lg := logger.New()
|
||||||
ctx := lg.WithContext(cmd.Context())
|
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 != "" {
|
if planDir != "" {
|
||||||
checkFirstSet()
|
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 != "" {
|
if planGit != "" {
|
||||||
|
Reference in New Issue
Block a user