Skip to content

Commit

Permalink
Move magician.go into pkg/
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
  • Loading branch information
jdolitsky committed Jul 19, 2021
1 parent 72e551b commit 35977ea
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ vendor/
.vscode/
bin/
credential-helpers/
cmd/docker-credential-magician/pkged.go
pkg/magician/pkged.go
sa.json
tmp/
.cache/
Expand Down
7 changes: 5 additions & 2 deletions cmd/docker-credential-magician/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ import (
"os"

"github.com/spf13/cobra"

"github.com/jdolitsky/docker-credential-magic/pkg/magician"
)

func main() {
rootCmd := &cobra.Command{
Use: "docker-credential-magician",
Short: "Augment images with various credential helpers (including magic)",
Args: cobra.MinimumNArgs(1),
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
ref := args[0]
return Abracadabra(ref)
var opts []magician.MagicOption
return magician.Abracadabra(ref, opts...)
},
}
if err := rootCmd.Execute(); err != nil {
Expand Down
6 changes: 3 additions & 3 deletions cmd/pkger-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ func main() {
panic(err)
}

info.Module.Path = filepath.Join(info.Module.Path, "cmd/docker-credential-magician")
info.Module.Dir = filepath.Join(info.Module.Dir, "cmd/docker-credential-magician")
info.Module.Path = filepath.Join(info.Module.Path, "pkg/magician")
info.Module.Dir = filepath.Join(info.Module.Dir, "pkg/magician")

fp := filepath.Join(info.Dir, "cmd/docker-credential-magician/pkged.go")
fp := filepath.Join(info.Dir, "pkg/magician/pkged.go")
os.RemoveAll(fp)

decls, err := parser.Parse(info, "/credential-helpers")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package magician

import (
"archive/tar"
Expand Down

0 comments on commit 35977ea

Please sign in to comment.