Skip to content

Commit

Permalink
Add regenerate pass through from scan to fingerprint
Browse files Browse the repository at this point in the history
  • Loading branch information
filip-debricked committed Aug 7, 2024
1 parent 5ff106a commit cee66f1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions build/docker/debian.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ RUN curl -fsSLO https://dot.net/v1/dotnet-install.sh \

ENV GOLANG_VERSION 1.22
RUN apt -y update && apt -y upgrade && apt -y install \
python3 \
python3-venv \
python3.10 \
python3.10-venv \
ca-certificates \
python3-pip && \
python3.10-pip && \
apt -y install -t unstable \
golang-$GOLANG_VERSION \
openjdk-21-jre && \
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/fingerprint/fingerprint.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func RunE(f fingerprint.IFingerprint) func(_ *cobra.Command, args []string) erro
if errors.Is(err, &fingerprint.FingerprintFileExistsError{}) {
fmt.Println(
"Fingerprint file exists and command is configured to not overwrite. ",
"To generate new fingerprint file either remove/rename old file or ",
"To generate a new fingerprint file either remove/rename old file or ",
"change flag '--regenerate' to 'true'",
)
return nil

Check failure on line 97 in internal/cmd/fingerprint/fingerprint.go

View workflow job for this annotation

GitHub Actions / Lint

return with no blank line before (nlreturn)
Expand Down
2 changes: 0 additions & 2 deletions internal/fingerprint/fingerprint.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ func (f *Fingerprinter) FingerprintFiles(options DebrickedOptions) (Fingerprints
if !errors.Is(err, os.ErrNotExist) {
fingerprintFileExists = true
}
fmt.Printf("output path=%s", options.OutputPath)
fmt.Printf("regen=%t, file=%t\n", options.Regenerate, fingerprintFileExists)
if !options.Regenerate && fingerprintFileExists {
return fingerprints, &FingerprintFileExistsError{}
}
Expand Down
1 change: 1 addition & 0 deletions internal/scan/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ func (dScanner *DebrickedScanner) scanFingerprint(options DebrickedOptions) erro
Inclusions: append(options.Inclusions, fingerprint.DefaultInclusionsFingerprint()...),
MinFingerprintContentLength: options.MinFingerprintContentLength,
FingerprintCompressedContent: false,
Regenerate: options.Regenerate > 0,
},
)
if err != nil {
Expand Down

0 comments on commit cee66f1

Please sign in to comment.