Refactor how client prepares environment. Inputs may now reference local directories

Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
Solomon Hykes
2021-01-28 14:58:13 -08:00
parent 6f4577d501
commit c4e55a6915
8 changed files with 251 additions and 217 deletions

View File

@@ -29,7 +29,7 @@ var computeCmd = &cobra.Command{
c, err := dagger.NewClient(ctx, dagger.ClientConfig{
Input: viper.GetString("input"),
BootDir: args[0],
Updater: localUpdater(args[0]),
})
if err != nil {
lg.Fatal().Err(err).Msg("unable to create client")
@@ -46,6 +46,16 @@ var computeCmd = &cobra.Command{
},
}
func localUpdater(dir string) string {
return fmt.Sprintf(`[
{
do: "local"
dir: "%s"
include: ["*.cue", "cue.mod"]
}
]`, dir)
}
func init() {
computeCmd.Flags().String("input", "", "Input overlay")