Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accumulating Codeium versions #58

Open
chrisgrieser opened this issue May 15, 2023 · 2 comments
Open

Accumulating Codeium versions #58

chrisgrieser opened this issue May 15, 2023 · 2 comments

Comments

@chrisgrieser
Copy link
Contributor

Not sure whether this is an issue with this plugin or with codeium itself, but I noticed that the codium server binaries of previous versions are all kept, resulting in a bloated directory containing them:
CleanShot 2023-05-15 at 10 23 20@2x

@WillEhrendreich
Copy link
Contributor

From what I can tell, there's no reason not to delete all of them except the latest, perhaps the latest couple if you're nervous about something specifically.

It's not a bug of the plugin, per se, it's more just that it doesn't provide a mechanism of cleaning up old versions of the server. It wouldn't be exceedingly difficult to do, but the plugin author might consider it beyond the scope of what he intends to support, or just simply hasn't because he doesn't see it as much of a priority, or something like that.

If you'd like to contribute, this would be a good first issue to provide a solution for, I'd be surprised if they wouldn't accept the pull request. :)

@chrisgrieser
Copy link
Contributor Author

yeah, I use this small code snippet in my build which does the job. can make a PR at some point, but skimming through the code base, I have yet to find the correct location for inserting it

{
	"jcdickinson/codeium.nvim",
	dependencies = { "nvim-lua/plenary.nvim", "hrsh7th/nvim-cmp" },
	build = function()
		local bin_path = vim.fn.stdpath("data") .. "/codeium"
		local oldBinaries = vim.fs.find(
			function() return true end,
			{ type = "file", limit = math.huge, path = bin_path }
		)
		table.remove(oldBinaries) -- remove last item (= most up to date binary) from list
		for _, binaryPath in pairs(oldBinaries) do
			os.remove(binaryPath)
			os.remove(vim.fs.dirname(binaryPath))
		end
	end,
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants