Skip to content

Commit

Permalink
feat: add tool for authenticating npm to artifact registry
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptammergard committed Nov 9, 2023
1 parent 4a0398b commit 2b4d11f
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tools/sgnpmartifactregistryauth/tools.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package sgnpmartifactregistryauth

import (
"context"
"os/exec"

"go.einride.tech/sage/sg"
)

const (
name = "npm-artifact-registry-auth"
)

func Command(ctx context.Context, args ...string) *exec.Cmd {
sg.Deps(ctx, PrepareCommand)
return sg.Command(ctx, sg.FromBinDir(name), args...)
}

func PrepareCommand(ctx context.Context) error {
sg.Logger(ctx).Println("authenticating npm to artifact registry...")
return sg.Command(
ctx,
"npx",
"[email protected]",
).Run()
}

0 comments on commit 2b4d11f

Please sign in to comment.