-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add tool for authenticating npm to artifact registry
- Loading branch information
1 parent
4a0398b
commit 2b4d11f
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} |