Skip to content

Commit 0022cd1

Browse files
authored
Fix npm publish NPE
1 parent 558a5d6 commit 0022cd1

File tree

7 files changed

+99
-55
lines changed

7 files changed

+99
-55
lines changed

artifactory/cli.go

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ func GetCommands() []cli.Command {
352352
ArgsUsage: common.CreateEnvVars(),
353353
BashComplete: corecommon.CreateBashCompletionFunc(),
354354
Action: func(c *cli.Context) error {
355-
return cliutils.RunConfigCmdWithDeprecationWarning("mvnc", utils.Maven, c, cliutils.CreateConfigCmd)
355+
return cliutils.RunConfigCmdWithDeprecationWarning("mvnc", "rt", utils.Maven, c, cliutils.CreateConfigCmd)
356356
},
357357
},
358358
{
@@ -377,7 +377,7 @@ func GetCommands() []cli.Command {
377377
ArgsUsage: common.CreateEnvVars(),
378378
BashComplete: corecommon.CreateBashCompletionFunc(),
379379
Action: func(c *cli.Context) error {
380-
return cliutils.RunConfigCmdWithDeprecationWarning("gradlec", utils.Gradle, c, cliutils.CreateConfigCmd)
380+
return cliutils.RunConfigCmdWithDeprecationWarning("gradlec", "rt", utils.Gradle, c, cliutils.CreateConfigCmd)
381381
},
382382
},
383383
{
@@ -493,7 +493,7 @@ func GetCommands() []cli.Command {
493493
ArgsUsage: common.CreateEnvVars(),
494494
BashComplete: corecommon.CreateBashCompletionFunc(),
495495
Action: func(c *cli.Context) error {
496-
return cliutils.RunConfigCmdWithDeprecationWarning("npmc", utils.Npm, c, cliutils.CreateConfigCmd)
496+
return cliutils.RunConfigCmdWithDeprecationWarning("npmc", "rt", utils.Npm, c, cliutils.CreateConfigCmd)
497497
},
498498
},
499499
{
@@ -534,7 +534,7 @@ func GetCommands() []cli.Command {
534534
SkipFlagParsing: true,
535535
BashComplete: corecommon.CreateBashCompletionFunc(),
536536
Action: func(c *cli.Context) error {
537-
return npmPublishCmd(c)
537+
return cliutils.RunNativeCmdWithDeprecationWarning("npm p", utils.Npm, c, npmPublishCmd)
538538
},
539539
},
540540
{
@@ -546,7 +546,7 @@ func GetCommands() []cli.Command {
546546
ArgsUsage: common.CreateEnvVars(),
547547
BashComplete: corecommon.CreateBashCompletionFunc(),
548548
Action: func(c *cli.Context) error {
549-
return cliutils.RunConfigCmdWithDeprecationWarning("yarnc", utils.Yarn, c, cliutils.CreateConfigCmd)
549+
return cliutils.RunConfigCmdWithDeprecationWarning("yarnc", "rt", utils.Yarn, c, cliutils.CreateConfigCmd)
550550
},
551551
},
552552
{
@@ -570,7 +570,7 @@ func GetCommands() []cli.Command {
570570
ArgsUsage: common.CreateEnvVars(),
571571
BashComplete: corecommon.CreateBashCompletionFunc(),
572572
Action: func(c *cli.Context) error {
573-
return cliutils.RunConfigCmdWithDeprecationWarning("nugetc", utils.Nuget, c, cliutils.CreateConfigCmd)
573+
return cliutils.RunConfigCmdWithDeprecationWarning("nugetc", "rt", utils.Nuget, c, cliutils.CreateConfigCmd)
574574
},
575575
},
576576
{
@@ -606,7 +606,7 @@ func GetCommands() []cli.Command {
606606
ArgsUsage: common.CreateEnvVars(),
607607
BashComplete: corecommon.CreateBashCompletionFunc(),
608608
Action: func(c *cli.Context) error {
609-
return cliutils.RunConfigCmdWithDeprecationWarning("dotnetc", utils.Dotnet, c, cliutils.CreateConfigCmd)
609+
return cliutils.RunConfigCmdWithDeprecationWarning("dotnetc", "rt", utils.Dotnet, c, cliutils.CreateConfigCmd)
610610
},
611611
},
612612
{
@@ -630,7 +630,7 @@ func GetCommands() []cli.Command {
630630
ArgsUsage: common.CreateEnvVars(),
631631
BashComplete: corecommon.CreateBashCompletionFunc(),
632632
Action: func(c *cli.Context) error {
633-
return cliutils.RunConfigCmdWithDeprecationWarning("go-config", utils.Go, c, cliutils.CreateConfigCmd)
633+
return cliutils.RunConfigCmdWithDeprecationWarning("go-config", "rt", utils.Go, c, cliutils.CreateConfigCmd)
634634
},
635635
},
636636
{
@@ -643,7 +643,7 @@ func GetCommands() []cli.Command {
643643
ArgsUsage: common.CreateEnvVars(),
644644
BashComplete: corecommon.CreateBashCompletionFunc(),
645645
Action: func(c *cli.Context) error {
646-
return cliutils.RunCmdWithDeprecationWarning("gp", c, buildtools.GoPublishCmd)
646+
return cliutils.RunCmdWithDeprecationWarning("gp", "rt", c, buildtools.GoPublishCmd)
647647
},
648648
},
649649
{
@@ -695,7 +695,7 @@ func GetCommands() []cli.Command {
695695
ArgsUsage: common.CreateEnvVars(),
696696
BashComplete: corecommon.CreateBashCompletionFunc(),
697697
Action: func(c *cli.Context) error {
698-
return cliutils.RunConfigCmdWithDeprecationWarning("pipc", utils.Pip, c, cliutils.CreateConfigCmd)
698+
return cliutils.RunConfigCmdWithDeprecationWarning("pipc", "rt", utils.Pip, c, cliutils.CreateConfigCmd)
699699
},
700700
},
701701
{
@@ -1179,6 +1179,7 @@ func npmDeprecatedInstallCiCmd(c *cli.Context, npmCmd *npm.NpmInstallOrCiCommand
11791179
return commands.Exec(npmCmd)
11801180
}
11811181

1182+
// Deprecated
11821183
func npmPublishCmd(c *cli.Context) error {
11831184
if show, err := cliutils.ShowCmdHelpIfNeeded(c, c.Args()); show || err != nil {
11841185
return err
@@ -1194,6 +1195,10 @@ func npmPublishCmd(c *cli.Context) error {
11941195
args := cliutils.ExtractCommand(c)
11951196
npmCmd := npm.NewNpmPublishCommand()
11961197
npmCmd.SetConfigFilePath(configFilePath).SetArgs(args)
1198+
err = npmCmd.Init()
1199+
if err != nil {
1200+
return err
1201+
}
11971202
err = commands.Exec(npmCmd)
11981203
if err != nil {
11991204
return err

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ require (
2525

2626
//replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.6.1-0.20211118142316-d9a261c51de9
2727

28-
//replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.4.3-0.20211118181121-5137c711021e
28+
replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.5.1-0.20211124154851-a2da7a5e9dc4
2929

3030
//replace github.com/jfrog/gocmd => github.com/jfrog/gocmd v0.5.4-0.20211116142418-92ddf344a6a4
3131

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ github.com/jfrog/gocmd v0.5.4 h1:+yrZ6e3HZXJf6knORZxfbF/LCsK7FTdzmxHPbAaJtQk=
229229
github.com/jfrog/gocmd v0.5.4/go.mod h1:nASNY/3Rv7M9VHjim+pIowo0I/fd38SJJm/Bxcp/Tww=
230230
github.com/jfrog/gofrog v1.1.0 h1:nhbfSVUYWRxKHeU0RsPAUQeo1suc4oAcEttIKQRvWhs=
231231
github.com/jfrog/gofrog v1.1.0/go.mod h1:9YN5v4LlsCfLIXpwQnzSf1wVtgjdHM20FzuIu58RMI4=
232-
github.com/jfrog/jfrog-cli-core/v2 v2.5.0 h1:s3/Lzm4NScRgStkdohC+FMcmPeBrm2GFgdIl+Q2QNsQ=
233-
github.com/jfrog/jfrog-cli-core/v2 v2.5.0/go.mod h1:DTkvS806Vn2aF23ng/ZcEXFpL0rIsVN6AMNsXY3nr0A=
232+
github.com/jfrog/jfrog-cli-core/v2 v2.5.1-0.20211124154851-a2da7a5e9dc4 h1:LzgAlm6OIiSKqJjOa3BJAg709/L/8HG/3NHBu48qK7c=
233+
github.com/jfrog/jfrog-cli-core/v2 v2.5.1-0.20211124154851-a2da7a5e9dc4/go.mod h1:DTkvS806Vn2aF23ng/ZcEXFpL0rIsVN6AMNsXY3nr0A=
234234
github.com/jfrog/jfrog-client-go v1.6.1 h1:uu1kr1pOHb0NmT+Equm+FwOOoksWCeSqBOdhmd+60HY=
235235
github.com/jfrog/jfrog-client-go v1.6.1/go.mod h1:oR5emUgDSN+T8jNXqimKy9VxszQQuWumv1bst8od3vU=
236236
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=

npm_test.go

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ import (
3030
)
3131

3232
type npmTestParams struct {
33-
testName string
34-
command string
33+
testName string
34+
nativeCommand string
35+
// Deprecated
36+
legacyCommand string
3537
repo string
3638
npmArgs string
3739
wd string
@@ -47,7 +49,16 @@ func cleanNpmTest() {
4749
tests.CleanFileSystem()
4850
}
4951

50-
func TestNpm(t *testing.T) {
52+
func TestNpmNativeSyntax(t *testing.T) {
53+
testNpm(t, false)
54+
}
55+
56+
// Deprecated
57+
func TestNpmLegacy(t *testing.T) {
58+
testNpm(t, true)
59+
}
60+
61+
func testNpm(t *testing.T, isLegacy bool) {
5162
initNpmTest(t)
5263
defer cleanNpmTest()
5364
wd, err := os.Getwd()
@@ -67,28 +78,32 @@ func TestNpm(t *testing.T) {
6778

6879
npmProjectPath, npmScopedProjectPath, npmNpmrcProjectPath, npmProjectCi := initNpmFilesTest(t)
6980
var npmTests = []npmTestParams{
70-
{testName: "npm ci", command: "npm ci", repo: tests.NpmRemoteRepo, wd: npmProjectCi, validationFunc: validateNpmInstall},
71-
{testName: "npm ci with module", command: "npm ci", repo: tests.NpmRemoteRepo, wd: npmProjectCi, moduleName: ModuleNameJFrogTest, validationFunc: validateNpmInstall},
72-
{testName: "npm i with module", command: "npm install", repo: tests.NpmRemoteRepo, wd: npmProjectPath, moduleName: ModuleNameJFrogTest, validationFunc: validateNpmInstall},
73-
{testName: "npm i with scoped project", command: "npm install", repo: tests.NpmRemoteRepo, wd: npmScopedProjectPath, validationFunc: validateNpmInstall},
74-
{testName: "npm i with npmrc project", command: "npm install", repo: tests.NpmRemoteRepo, wd: npmNpmrcProjectPath, validationFunc: validateNpmInstall},
75-
{testName: "npm i with production", command: "npm install", repo: tests.NpmRemoteRepo, wd: npmProjectPath, validationFunc: validateNpmInstall, npmArgs: "--production"},
76-
{testName: "npm i with npmrc project", command: "npm i", repo: tests.NpmRemoteRepo, wd: npmNpmrcProjectPath, validationFunc: validateNpmPackInstall, npmArgs: "yaml"},
77-
{testName: "npmp with module", command: "npm p", repo: tests.NpmRepo, wd: npmScopedProjectPath, moduleName: ModuleNameJFrogTest, validationFunc: validateNpmScopedPublish},
78-
{testName: "npmp", command: "npm publish", repo: tests.NpmRepo, wd: npmProjectPath, validationFunc: validateNpmPublish},
79-
{testName: "npm conditional publish", command: "npm publish --scan", repo: tests.NpmRepo, wd: npmProjectPath, validationFunc: validateNpmPublish},
81+
{testName: "npm ci", nativeCommand: "npm ci", legacyCommand: "rt npmci", repo: tests.NpmRemoteRepo, wd: npmProjectCi, validationFunc: validateNpmInstall},
82+
{testName: "npm ci with module", nativeCommand: "npm ci", legacyCommand: "rt npmci", repo: tests.NpmRemoteRepo, wd: npmProjectCi, moduleName: ModuleNameJFrogTest, validationFunc: validateNpmInstall},
83+
{testName: "npm i with module", nativeCommand: "npm install", legacyCommand: "rt npm-install", repo: tests.NpmRemoteRepo, wd: npmProjectPath, moduleName: ModuleNameJFrogTest, validationFunc: validateNpmInstall},
84+
{testName: "npm i with scoped project", nativeCommand: "npm install", legacyCommand: "rt npm-install", repo: tests.NpmRemoteRepo, wd: npmScopedProjectPath, validationFunc: validateNpmInstall},
85+
{testName: "npm i with npmrc project", nativeCommand: "npm install", legacyCommand: "rt npm-install", repo: tests.NpmRemoteRepo, wd: npmNpmrcProjectPath, validationFunc: validateNpmInstall},
86+
{testName: "npm i with production", nativeCommand: "npm install", legacyCommand: "rt npm-install", repo: tests.NpmRemoteRepo, wd: npmProjectPath, validationFunc: validateNpmInstall, npmArgs: "--production"},
87+
{testName: "npm i with npmrc project", nativeCommand: "npm i", legacyCommand: "rt npmi", repo: tests.NpmRemoteRepo, wd: npmNpmrcProjectPath, validationFunc: validateNpmPackInstall, npmArgs: "yaml"},
88+
{testName: "npm p with module", nativeCommand: "npm p", legacyCommand: "rt npmp", repo: tests.NpmRepo, wd: npmScopedProjectPath, moduleName: ModuleNameJFrogTest, validationFunc: validateNpmScopedPublish},
89+
{testName: "npm p", nativeCommand: "npm publish", legacyCommand: "rt npm-publish", repo: tests.NpmRepo, wd: npmProjectPath, validationFunc: validateNpmPublish},
90+
{testName: "npm conditional publish", nativeCommand: "npm publish --scan", legacyCommand: "rt npm-publish --scan", repo: tests.NpmRepo, wd: npmProjectPath, validationFunc: validateNpmPublish},
8091
}
8192

8293
for i, npmTest := range npmTests {
8394
t.Run(npmTest.testName, func(t *testing.T) {
95+
npmCmd := npmTest.nativeCommand
96+
if isLegacy {
97+
npmCmd = npmTest.legacyCommand
98+
}
8499
err = os.Chdir(filepath.Dir(npmTest.wd))
85100
assert.NoError(t, err)
86101
npmrcFileInfo, err := os.Stat(".npmrc")
87102
if err != nil && !os.IsNotExist(err) {
88103
assert.Fail(t, err.Error())
89104
}
90105
var buildNumber string
91-
commandArgs := strings.Split(npmTest.command, " ")
106+
commandArgs := strings.Split(npmCmd, " ")
92107
buildNumber = strconv.Itoa(i + 100)
93108
commandArgs = append(commandArgs, npmTest.npmArgs)
94109

@@ -231,12 +246,11 @@ func validateNpmInstall(t *testing.T, npmTestParams npmTestParams, isNpm7 bool)
231246
return
232247
}
233248
buildInfo := publishedBuildInfo.BuildInfo
234-
if buildInfo.Modules == nil || len(buildInfo.Modules) == 0 {
235-
// Case no module was created
236-
t.Error(fmt.Sprintf("npm install test with command '%s' and repo '%s' failed", npmTestParams.command, npmTestParams.repo))
249+
if buildInfo.Modules == nil {
250+
assert.NotNil(t, buildInfo.Modules)
237251
return
238252
}
239-
253+
assert.NotEmpty(t, buildInfo.Modules)
240254
equalDependenciesSlices(t, expectedDependencies, buildInfo.Modules[0].Dependencies)
241255
}
242256

pip_test.go

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,16 @@ type PipCmd struct {
2424
Options []string
2525
}
2626

27-
func TestPipInstall(t *testing.T) {
27+
func TestPipInstallNativeSyntax(t *testing.T) {
28+
testPipInstall(t, false)
29+
}
30+
31+
// Deprecated
32+
func TestPipInstallLegacy(t *testing.T) {
33+
testPipInstall(t, true)
34+
}
35+
36+
func testPipInstall(t *testing.T, isLegacy bool) {
2837
// Init pip.
2938
initPipTest(t)
3039

@@ -53,17 +62,22 @@ func TestPipInstall(t *testing.T) {
5362
expectedDependencies int
5463
cleanAfterExecution bool
5564
}{
56-
{"setuppy", "setuppyproject", "setuppy", "jfrog-python-example", []string{"pip", "install", ".", "--no-cache-dir", "--force-reinstall", "--build-name=" + tests.PipBuildName}, 3, true},
57-
{"setuppy-verbose", "setuppyproject", "setuppy-verbose", "jfrog-python-example", []string{"pip", "install", ".", "--no-cache-dir", "--force-reinstall", "-v", "--build-name=" + tests.PipBuildName}, 3, true},
58-
{"setuppy-with-module", "setuppyproject", "setuppy-with-module", "setuppy-with-module", []string{"pip", "install", ".", "--no-cache-dir", "--force-reinstall", "--build-name=" + tests.PipBuildName, "--module=setuppy-with-module"}, 3, true},
59-
{"requirements", "requirementsproject", "requirements", tests.PipBuildName, []string{"pip", "install", "-r", "requirements.txt", "--no-cache-dir", "--force-reinstall", "--build-name=" + tests.PipBuildName}, 5, true},
60-
{"requirements-verbose", "requirementsproject", "requirements-verbose", tests.PipBuildName, []string{"pip", "install", "-r", "requirements.txt", "--no-cache-dir", "--force-reinstall", "-v", "--build-name=" + tests.PipBuildName}, 5, false},
61-
{"requirements-use-cache", "requirementsproject", "requirements-verbose", "requirements-verbose-use-cache", []string{"pip", "install", "-r", "requirements.txt", "--module=requirements-verbose-use-cache", "--build-name=" + tests.PipBuildName}, 5, true},
65+
{"setuppy", "setuppyproject", "setuppy", "jfrog-python-example", []string{".", "--no-cache-dir", "--force-reinstall", "--build-name=" + tests.PipBuildName}, 3, true},
66+
{"setuppy-verbose", "setuppyproject", "setuppy-verbose", "jfrog-python-example", []string{".", "--no-cache-dir", "--force-reinstall", "-v", "--build-name=" + tests.PipBuildName}, 3, true},
67+
{"setuppy-with-module", "setuppyproject", "setuppy-with-module", "setuppy-with-module", []string{".", "--no-cache-dir", "--force-reinstall", "--build-name=" + tests.PipBuildName, "--module=setuppy-with-module"}, 3, true},
68+
{"requirements", "requirementsproject", "requirements", tests.PipBuildName, []string{"-r", "requirements.txt", "--no-cache-dir", "--force-reinstall", "--build-name=" + tests.PipBuildName}, 5, true},
69+
{"requirements-verbose", "requirementsproject", "requirements-verbose", tests.PipBuildName, []string{"-r", "requirements.txt", "--no-cache-dir", "--force-reinstall", "-v", "--build-name=" + tests.PipBuildName}, 5, false},
70+
{"requirements-use-cache", "requirementsproject", "requirements-verbose", "requirements-verbose-use-cache", []string{"-r", "requirements.txt", "--module=requirements-verbose-use-cache", "--build-name=" + tests.PipBuildName}, 5, true},
6271
}
6372

6473
// Run test cases.
6574
for buildNumber, test := range allTests {
6675
t.Run(test.name, func(t *testing.T) {
76+
if isLegacy {
77+
test.args = append([]string{"rt", "pip-install"}, test.args...)
78+
} else {
79+
test.args = append([]string{"pip", "install"}, test.args...)
80+
}
6781
testPipCmd(t, test.name, createPipProject(t, test.outputFolder, test.project), strconv.Itoa(buildNumber), test.moduleId, test.expectedDependencies, test.args)
6882
if test.cleanAfterExecution {
6983
// cleanup

utils/cliutils/utils.go

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -516,30 +516,41 @@ func CreateConfigCmd(c *cli.Context, confType artifactoryUtils.ProjectType) erro
516516

517517
func RunNativeCmdWithDeprecationWarning(cmdName string, projectType artifactoryUtils.ProjectType, c *cli.Context, cmd func(c *cli.Context) error) error {
518518
if shouldLogWarning() {
519-
log.Warn(`You are using a deprecated syntax of the command.
520-
The new command syntax is quite similar to the current syntax, and is similar to the ` + projectType.String() + ` CLI command, with the addition of a prefix of the 'jf' executable name, i.e.:
521-
$ jf ` + cmdName + ` [` + projectType.String() + ` args and option] --build-name=*BUILD_NAME* --build-number=*BUILD_NUMBER*`)
519+
logNativeCommandDeprecation(cmdName, projectType.String())
522520
}
523521
return cmd(c)
524522
}
525523

526-
func RunConfigCmdWithDeprecationWarning(cmdName string, confType artifactoryUtils.ProjectType, c *cli.Context,
524+
func logNativeCommandDeprecation(cmdName, projectType string) {
525+
log.Warn(
526+
`You are using a deprecated syntax of the command.
527+
The new command syntax is quite similar to the syntax used by the native ` + projectType + ` client.
528+
All you need to do is to add '` + coreutils.GetCliExecutableName() + `' as a prefix to the command.
529+
For example:
530+
$ ` + coreutils.GetCliExecutableName() + ` ` + cmdName + ` ...
531+
The --build-name and --build-number options are still supported.`)
532+
}
533+
534+
func RunConfigCmdWithDeprecationWarning(cmdName, oldSubcommand string, confType artifactoryUtils.ProjectType, c *cli.Context,
527535
cmd func(c *cli.Context, confType artifactoryUtils.ProjectType) error) error {
528-
logNonNativeCommandDeprecation(cmdName)
536+
logNonNativeCommandDeprecation(cmdName, oldSubcommand)
529537
return cmd(c, confType)
530538
}
531539

532-
func RunCmdWithDeprecationWarning(cmdName string, c *cli.Context,
540+
func RunCmdWithDeprecationWarning(cmdName, oldSubcommand string, c *cli.Context,
533541
cmd func(c *cli.Context) error) error {
534-
logNonNativeCommandDeprecation(cmdName)
542+
logNonNativeCommandDeprecation(cmdName, oldSubcommand)
535543
return cmd(c)
536544
}
537545

538-
func logNonNativeCommandDeprecation(cmdName string) {
546+
func logNonNativeCommandDeprecation(cmdName, oldSubcommand string) {
539547
if shouldLogWarning() {
540-
log.Warn(`You are using a deprecated syntax of the command.
541-
The new command syntax is similar to the current syntax, without the subcommand, i.e.:
542-
$ jf ` + cmdName + ` [args and option]`)
548+
log.Warn(
549+
`You are using a deprecated syntax of the command.
550+
Instead of:
551+
$ ` + coreutils.GetCliExecutableName() + ` ` + oldSubcommand + ` ` + cmdName + ` ...
552+
Use:
553+
$ ` + coreutils.GetCliExecutableName() + ` ` + cmdName + ` ...`)
543554
}
544555
}
545556

xray/cli.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func GetCommands() []cli.Command {
4949
ArgsUsage: common.CreateEnvVars(),
5050
BashComplete: corecommondocs.CreateBashCompletionFunc(),
5151
Action: func(c *cli.Context) error {
52-
return cliutils.RunCmdWithDeprecationWarning("audit-mvn", c, scan.AuditMvnCmd)
52+
return cliutils.RunCmdWithDeprecationWarning("audit-mvn", "xr", c, scan.AuditMvnCmd)
5353
},
5454
},
5555
{
@@ -61,7 +61,7 @@ func GetCommands() []cli.Command {
6161
ArgsUsage: common.CreateEnvVars(),
6262
BashComplete: corecommondocs.CreateBashCompletionFunc(),
6363
Action: func(c *cli.Context) error {
64-
return cliutils.RunCmdWithDeprecationWarning("audit-gradle", c, scan.AuditGradleCmd)
64+
return cliutils.RunCmdWithDeprecationWarning("audit-gradle", "xr", c, scan.AuditGradleCmd)
6565
},
6666
},
6767
{
@@ -73,7 +73,7 @@ func GetCommands() []cli.Command {
7373
ArgsUsage: common.CreateEnvVars(),
7474
BashComplete: corecommondocs.CreateBashCompletionFunc(),
7575
Action: func(c *cli.Context) error {
76-
return cliutils.RunCmdWithDeprecationWarning("audit-npm", c, scan.AuditNpmCmd)
76+
return cliutils.RunCmdWithDeprecationWarning("audit-npm", "xr", c, scan.AuditNpmCmd)
7777
},
7878
},
7979
{
@@ -85,7 +85,7 @@ func GetCommands() []cli.Command {
8585
ArgsUsage: common.CreateEnvVars(),
8686
BashComplete: corecommondocs.CreateBashCompletionFunc(),
8787
Action: func(c *cli.Context) error {
88-
return cliutils.RunCmdWithDeprecationWarning("audit-go", c, scan.AuditGoCmd)
88+
return cliutils.RunCmdWithDeprecationWarning("audit-go", "xr", c, scan.AuditGoCmd)
8989
},
9090
},
9191
{
@@ -97,7 +97,7 @@ func GetCommands() []cli.Command {
9797
ArgsUsage: common.CreateEnvVars(),
9898
BashComplete: corecommondocs.CreateBashCompletionFunc(),
9999
Action: func(c *cli.Context) error {
100-
return cliutils.RunCmdWithDeprecationWarning("audit-pip", c, scan.AuditPipCmd)
100+
return cliutils.RunCmdWithDeprecationWarning("audit-pip", "xr", c, scan.AuditPipCmd)
101101
},
102102
},
103103
{
@@ -110,7 +110,7 @@ func GetCommands() []cli.Command {
110110
ArgsUsage: common.CreateEnvVars(),
111111
BashComplete: corecommondocs.CreateBashCompletionFunc(),
112112
Action: func(c *cli.Context) error {
113-
return cliutils.RunCmdWithDeprecationWarning("scan", c, scan.ScanCmd)
113+
return cliutils.RunCmdWithDeprecationWarning("scan", "xr", c, scan.ScanCmd)
114114
},
115115
},
116116
{

0 commit comments

Comments
 (0)