Skip to content

Commit

Permalink
added PersistentPreRunE: configureInstaller,
Browse files Browse the repository at this point in the history
  • Loading branch information
thorstendb-ARM committed Jun 13, 2023
1 parent 3defbf3 commit dc6443b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions cmd/commands/checksum.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ The default Cryptographic Hash Function used is "` + cryptography.Hashes[0] + `"
might be supported. The used function will be prefixed to the ".checksum" extension.
By default the checksum file will be created in the same directory as the provided pack.`,
Args: cobra.ExactArgs(1),
Args: cobra.ExactArgs(1),
PersistentPreRunE: configureInstaller,
RunE: func(cmd *cobra.Command, args []string) error {
return cryptography.GenerateChecksum(args[0], checksumCreateCmdFlags.outputDir, checksumCreateCmdFlags.hashAlgorithm)
},
Expand All @@ -73,7 +74,8 @@ with "checksum-create"), present in the same directory:
The used hash function is inferred from the checksum filename, and if any of the digests
computed doesn't match the one provided in the checksum file an error will be thrown.
If the .checksum file is in another directory, specify it with the -p/--path flag`,
Args: cobra.ExactArgs(1),
Args: cobra.ExactArgs(1),
PersistentPreRunE: configureInstaller,
RunE: func(cmd *cobra.Command, args []string) error {
if checksumVerifyCmdFlags.checksumPath != "" {
return cryptography.VerifyChecksum(args[0], checksumVerifyCmdFlags.checksumPath)
Expand Down
6 changes: 4 additions & 2 deletions cmd/commands/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ These can be viewed with any text/hex editor or dedicated zip tools like "zipinf
The referenced pack must be in its original/compressed form (.pack), and be present locally:
$ cpackget signature-create Vendor.Pack.1.2.3.pack -k private.key -c certificate.pem`,
Args: cobra.ExactArgs(1),
Args: cobra.ExactArgs(1),
PersistentPreRunE: configureInstaller,
RunE: func(cmd *cobra.Command, args []string) error {
if signatureCreateflags.keyPath == "" {
if !signatureCreateflags.certOnly {
Expand Down Expand Up @@ -152,7 +153,8 @@ the publisher's public PGP key.
The referenced pack must be in its original/compressed form (.pack), and be present locally:
$ cpackget signature-verify Vendor.Pack.1.2.3.pack.signed`,
Args: cobra.ExactArgs(1),
Args: cobra.ExactArgs(1),
PersistentPreRunE: configureInstaller,
RunE: func(cmd *cobra.Command, args []string) error {
if signatureVerifyflags.export && (signatureVerifyflags.skipCertValidation || signatureVerifyflags.skipInfo) {
log.Error("-e/--export does not need any other flags")
Expand Down
1 change: 0 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
log "github.com/sirupsen/logrus"
)

// foo comment
func main() {
log.SetFormatter(new(LogFormatter))
log.SetOutput(os.Stdout)
Expand Down

0 comments on commit dc6443b

Please sign in to comment.