<commit_before>package main

import (
	"encoding/json"
	"os"
	"path/filepath"
)

var pluginCachePath = filepath.Join(AppDir(), "plugin-cache.json")

// UpdatePluginCache updates all the plugins in ~/.heroku/plugin-cache.json
func UpdatePluginCache() {
	cache := FetchPluginCache()
	for _, plugin := range cache {
		cache[plugin.Name] = getPlugin(plugin.Name, false)
	}
	savePluginCache(cache)
}

// AddPluginsToCache adds/updates a set of plugins to ~/.heroku/plugin-cache.json
func AddPluginsToCache(plugins ...*Plugin) {
	cache := FetchPluginCache()
	for _, plugin := range plugins {
		if plugin != nil {
			cache[plugin.Name] = plugin<commit_msg>get even nil plugins when updating<commit_after>package main

import (
	"encoding/json"
	"os"
	"path/filepath"
)

var pluginCachePath = filepath.Join(AppDir(), "plugin-cache.json")

// UpdatePluginCache updates all the plugins in ~/.heroku/plugin-cache.json
func UpdatePluginCache() {
	cache := FetchPluginCache()
	for name := range cache {
		cache[name] = getPlugin(name, false)
	}
	savePluginCache(cache)
}

// AddPluginsToCache adds/updates a set of plugins to ~/.heroku/plugin-cache.json
func AddPluginsToCache(plugins ...*Plugin) {
	cache := FetchPluginCache()
	for _, plugin := range plugins {
		if plugin != nil {
			cache[plugin.Name] = plugin
{'fraction_non_alphanumeric': 0.13, 'fraction_numerical': 0.0, 'mean_word_length': 4.489451476793249, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5782850', 'n_tokens_mistral': 431, 'n_tokens_neox': 422, 'n_words': 106}