From 09e24eaf5bc707fdeb63eabb4e04e6cb9240a384 Mon Sep 17 00:00:00 2001 From: Charlie Voiselle <464492+angrycub@users.noreply.github.com> Date: Wed, 30 Aug 2023 11:09:50 -0400 Subject: [PATCH 1/3] Fix incorrect argument use --- internal/cli/generate_registry.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/cli/generate_registry.go b/internal/cli/generate_registry.go index 69526ffd..c8f67f0a 100644 --- a/internal/cli/generate_registry.go +++ b/internal/cli/generate_registry.go @@ -32,12 +32,12 @@ func (c *GenerateRegistryCommand) Run(args []string) int { return 1 } - c.cfg.PackName = c.args[0] + c.cfg.RegistryName = c.args[0] // Generate our UI error context. errorContext := errors.NewUIErrorContext() - errorContext.Add(errors.UIContextPrefixRegistryName, c.cfg.PackName) + errorContext.Add(errors.UIContextPrefixRegistryName, c.cfg.RegistryName) errorContext.Add(errors.UIContextPrefixOutputPath, c.cfg.OutPath) err := creator.CreateRegistry(c.cfg) @@ -89,7 +89,6 @@ func (c *GenerateRegistryCommand) Help() string { c.Example = ` # Create a new registry named "my-new-registry" in the current directory. nomad-pack generate registry my-new-registry - ` return formatHelp(` Usage: nomad-pack generate registry From cc8d5496fd3ad2f3a62d9096e2d31c06940ef961 Mon Sep 17 00:00:00 2001 From: Charlie Voiselle <464492+angrycub@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:47:37 -0400 Subject: [PATCH 2/3] Add CHANGELOG --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cae4e513..aaa10251 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,10 @@ the pack to their cluster. * **Vendoring Dependencies** - With `nomad-pack deps vendor`, you can automatically download all the dependencies listed in the `metadata.hcl` file -into a `deps/` subdirectory. +into a `deps/` subdirectory. + +BUG FIXES: +* cli: `generate registry` command creates registry in properly named folder [[GH-445](https://github.com/hashicorp/nomad-pack/pull/445)] IMPROVEMENTS: From f41576766f8282251795d51e2b57a39a358fdd6a Mon Sep 17 00:00:00 2001 From: Charlie Voiselle <464492+angrycub@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:09:41 -0400 Subject: [PATCH 3/3] Put sample pack inside `packs` folder --- internal/creator/pack.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/creator/pack.go b/internal/creator/pack.go index f9af2d83..0054f415 100644 --- a/internal/creator/pack.go +++ b/internal/creator/pack.go @@ -34,9 +34,9 @@ type packCreator struct { func CreatePack(c config.PackConfig) error { ui := c.GetUI() - var outPath string + outPath := c.OutPath var err error - if c.OutPath == "" { + if outPath == "" { outPath, err = os.Getwd() if err != nil { newCreatePackError(err)