func (i *IDB) Generate(opts *options.Options, path string) error {
	idbPath := filepath.Join(opts.WorkDir, "lib", "apk", "db", "installed")

	idbData, err := os.ReadFile(idbPath)
	if err != nil {
		return fmt.Errorf("reading installed db for copying: %w", err)
	}

	if err := os.WriteFile(path, idbData, 0o600); err != nil {
		return fmt.Errorf("copying installed db: %w", err)
	}

	return nil
}
// Generate copies the IDB from the work directory and saves it as
// an SBOM.
Generate copies the IDB from the work directory and saves it as
an SBOM.
// Generate copies the IDB from the work directory and saves it as // an SBOM .
func (i *IDB) Generate(opts *options.Options, path string) error {
	idbPath := filepath.Join(opts.WorkDir, "lib", "apk", "db", "installed")
	idbData, err := os.ReadFile(idbPath)
	if err != nil {
		return fmt.Errorf("reading installed db for copying: %w", err)
	}
	if err := os.WriteFile(path, idbData, 0o600); err != nil {
		return fmt.Errorf("copying installed db: %w", err)
	}
	return nil
}
func ( i * IDB ) Generate ( opts * options . Options , path string ) error { idbPath := filepath . Join ( opts . WorkDir , " " , " " , " " , " " ) idbData , err := os . ReadFile ( idbPath ) if err != nil { return fmt . Errorf ( " " , err ) } if err := os . WriteFile ( path , idbData , 0o600 ) ; err != nil { return fmt . Errorf ( " " , err ) } return nil }
Generate copies the IDB from the work directory and saves it as
an SBOM.
Generate copies the IDB from the work directory and saves it as an SBOM .