-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from nexB/11-nuget
Support lockfile generation for NuGet project
- Loading branch information
Showing
6 changed files
with
102 additions
and
13 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
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,39 @@ | ||
/* | ||
Copyright (c) nexB Inc. and others. All rights reserved. | ||
ScanCode is a trademark of nexB Inc. | ||
SPDX-License-Identifier: Apache-2.0 | ||
See http://www.apache.org/licenses/LICENSE-2.0 for the license text. | ||
See https://github.com/nexB/dependency-inspector for support or download. | ||
See https://aboutcode.org for more information about nexB OSS projects. | ||
*/ | ||
|
||
package cmd | ||
|
||
import ( | ||
"github.com/nexB/dependency-inspector/internal" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func nugetCmd() *cobra.Command { | ||
forced := false | ||
|
||
nugetCmd := &cobra.Command{ | ||
Use: "nuget [path]", | ||
Short: "Generate lockfile for NuGet project", | ||
Long: `Create lockfile for NuGet project if it doesn't exist in the specified [path]. | ||
If no path is provided, the command defaults to the current directory.`, | ||
Args: cobra.MaximumNArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
internal.CreateLockFileNuGet( | ||
args, | ||
forced, | ||
) | ||
}, | ||
} | ||
|
||
nugetCmd.Flags().BoolVarP(&forced, "force", "f", false, "Generate lockfile forcibly, ignoring existing lockfiles") | ||
|
||
return nugetCmd | ||
} |
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
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
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
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