diff options
| author | Fuwn <[email protected]> | 2024-10-25 09:56:14 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-25 10:12:22 +0000 |
| commit | 4b64fdd0cd1709b8b4ce3a0aff50f2e1e8f30fbb (patch) | |
| tree | 65a3d5c4ad125dfde8981d0f9ab97815bcae7aaf /internal/commands | |
| parent | fix(source): dynamically identify host (diff) | |
| download | yae-4b64fdd0cd1709b8b4ce3a0aff50f2e1e8f30fbb.tar.xz yae-4b64fdd0cd1709b8b4ce3a0aff50f2e1e8f30fbb.zip | |
feat(yae): add optional schema field
Diffstat (limited to 'internal/commands')
| -rw-r--r-- | internal/commands/add.go | 2 | ||||
| -rw-r--r-- | internal/commands/drop.go | 2 | ||||
| -rw-r--r-- | internal/commands/init.go | 2 | ||||
| -rw-r--r-- | internal/commands/update.go | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/internal/commands/add.go b/internal/commands/add.go index 1b32533..07bee28 100644 --- a/internal/commands/add.go +++ b/internal/commands/add.go @@ -50,7 +50,7 @@ func AddFlags() []cli.Flag { } } -func Add(sources *yae.Sources) func(c *cli.Context) error { +func Add(sources *yae.Environment) func(c *cli.Context) error { return func(c *cli.Context) error { if c.Args().Len() != 2 { return fmt.Errorf("invalid number of arguments") diff --git a/internal/commands/drop.go b/internal/commands/drop.go index f30afb6..788b62b 100644 --- a/internal/commands/drop.go +++ b/internal/commands/drop.go @@ -7,7 +7,7 @@ import ( "github.com/urfave/cli/v2" ) -func Drop(sources *yae.Sources) func(c *cli.Context) error { +func Drop(sources *yae.Environment) func(c *cli.Context) error { return func(c *cli.Context) error { if c.Args().Len() == 0 { return fmt.Errorf("invalid number of arguments") diff --git a/internal/commands/init.go b/internal/commands/init.go index 4d41553..c4bc138 100644 --- a/internal/commands/init.go +++ b/internal/commands/init.go @@ -8,7 +8,7 @@ import ( "github.com/urfave/cli/v2" ) -func Init(sources *yae.Sources) func(c *cli.Context) error { +func Init(sources *yae.Environment) func(c *cli.Context) error { return func(c *cli.Context) error { if _, err := os.Stat(c.String("sources")); err == nil { return fmt.Errorf("sources file already exists") diff --git a/internal/commands/update.go b/internal/commands/update.go index fa7e09f..5889d3a 100644 --- a/internal/commands/update.go +++ b/internal/commands/update.go @@ -28,14 +28,14 @@ func UpdateFlags() []cli.Flag { } } -func Update(sources *yae.Sources) func(c *cli.Context) error { +func Update(sources *yae.Environment) func(c *cli.Context) error { return func(c *cli.Context) error { updates := []string{} force := c.Bool("force-hashed") forcePinned := c.Bool("force-pinned") if c.Args().Len() == 0 { - for name, source := range *sources { + for name, source := range sources.Sources { if updated, err := source.Update(sources, name, force, forcePinned); err != nil { return err } else if updated { @@ -44,7 +44,7 @@ func Update(sources *yae.Sources) func(c *cli.Context) error { } } else { name := c.Args().Get(0) - source := (*sources)[name] + source := (*sources).Sources[name] if updated, err := source.Update(sources, name, force, forcePinned); err != nil { return err |