feat: add build.lua to auto download native on lazy

This commit is contained in:
əlemi 2024-09-05 05:16:18 +02:00
parent a0b7888878
commit fff083a9fb
Signed by: alemi
GPG key ID: A4895B84D311642C

4
lua/codemp/build.lua Normal file
View file

@ -0,0 +1,4 @@
local plugin_dir = vim.fn.fnamemodify(debug.getinfo(1, "S").source:sub(2), ":p:h") -- got this from https://lazy.folke.io/developers#building
local native_path = plugin_dir .. "/native.so" -- TODO get extension based on platform
local download_url = "https://codemp.dev/releases/lua/codemp_native-linux.so" -- TODO get url based on platform
vim.system({"curl", "-s", "-o", native_path, download_url }) -- TODO can we run this asynchronously?