mirror of
https://github.com/hyzendust/KickestEnd.nvim.git
synced 2026-02-15 00:21:15 +01:00
Fix: rollback to non-sudo custom_snippet replacement handler
This commit is contained in:
@@ -1,35 +1,35 @@
|
||||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||
"LuaSnip": { "branch": "master", "commit": "f958d9837c8fa7816bb8fb54977e658affc63c31" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "2b3cbcdd980cae1e022409289245053f62fb50f6" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
|
||||
"LuaSnip": { "branch": "master", "commit": "3732756842a2f7e0e76a7b0487e9692072857277" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "3979b01cb05734331c7873049001d3f2bb8477f4" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"conform.nvim": { "branch": "master", "commit": "fbcb4fa7f34bfea9be702ffff481a8e336ebf6ed" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" },
|
||||
"conform.nvim": { "branch": "master", "commit": "1bf8b5b9caee51507aa51eaed3da5b0f2595c6b9" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "e32b672d8fd343f9d6a76944fedb8c61d7d8111a" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "cdafc320f03f2572c40ab93a4eecb733d4016d07" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "aef7f5cec0a40dbe7f3304214850c472e2264b10" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
|
||||
"mason-conform.nvim": { "branch": "main", "commit": "48da2ebd5efbaf8a99566eadc3ece82d523f03c5" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "2304ff65ecc8cb2afc2484de3e2ed9a407edf0b9" },
|
||||
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "c4c168e459395275c552179a1baf9c3d885d6a74" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "7d527c76c43f46294de9c19d39c5a86317809b4b" },
|
||||
"mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "a7bcf1d88069fc67c9ace8a62ba480b8fe879025" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "ac98db2f9f06a56498ec890a96928774eae412c3" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "d97d85e01339f01b842e6ec1502f639b080cb0fc" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "b7c48a7111534b66bee077da8035ac7208a294ff" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
|
||||
"vim-rhubarb": { "branch": "master", "commit": "5496d7c94581c4c9ad7430357449bb57fc59f501" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "b4177e3eaf15fe5eb8357ebac2286d488be1ed00" }
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
}
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
local uv = vim.loop
|
||||
-- Force user home directory so script works even under sudo
|
||||
local user_home = '/home/hexzon3'
|
||||
|
||||
local home = uv.os_homedir()
|
||||
-- Detect OS and base path of friendly-snippets
|
||||
local function get_friendly_snippets_base_path()
|
||||
local os_name = uv.os_uname().sysname
|
||||
if os_name == 'Windows_NT' then
|
||||
return user_home .. '\\.local\\share\\nvim\\lazy\\friendly-snippets\\snippets\\'
|
||||
return home .. '\\.local\\share\\nvim\\lazy\\friendly-snippets\\snippets\\'
|
||||
else
|
||||
return user_home .. '/.local/share/nvim/lazy/friendly-snippets/snippets/'
|
||||
return home .. '/.local/share/nvim/lazy/friendly-snippets/snippets/'
|
||||
end
|
||||
end
|
||||
|
||||
local target_base = get_friendly_snippets_base_path()
|
||||
local custom_snippets_dir = vim.fn.stdpath 'config' .. '/custom_friendly_snippets/'
|
||||
|
||||
-- Read all files in custom_snippets_dir
|
||||
local function get_custom_snippet_files()
|
||||
local handle = uv.fs_scandir(custom_snippets_dir)
|
||||
@@ -34,15 +30,12 @@ local function get_custom_snippet_files()
|
||||
end
|
||||
return files
|
||||
end
|
||||
|
||||
-- Replace each snippet file
|
||||
local function replace_snippets()
|
||||
local files = get_custom_snippet_files()
|
||||
for _, filename in ipairs(files) do
|
||||
local source_path = custom_snippets_dir .. filename
|
||||
local target_path = target_base .. filename
|
||||
|
||||
-- Read source content
|
||||
local source_file = io.open(source_path, 'r')
|
||||
if not source_file then
|
||||
vim.notify('Failed to read: ' .. source_path, vim.log.levels.ERROR)
|
||||
@@ -50,7 +43,6 @@ local function replace_snippets()
|
||||
end
|
||||
local source_content = source_file:read '*a'
|
||||
source_file:close()
|
||||
|
||||
-- Read target content (if exists)
|
||||
local target_content = ''
|
||||
local target_file = io.open(target_path, 'r')
|
||||
@@ -58,7 +50,6 @@ local function replace_snippets()
|
||||
target_content = target_file:read '*a'
|
||||
target_file:close()
|
||||
end
|
||||
|
||||
-- Only update if different
|
||||
if source_content ~= target_content then
|
||||
-- Create backup if not exists
|
||||
@@ -73,7 +64,6 @@ local function replace_snippets()
|
||||
end
|
||||
end
|
||||
|
||||
-- Write updated content
|
||||
local output = io.open(target_path, 'w')
|
||||
if output then
|
||||
output:write(source_content)
|
||||
@@ -83,10 +73,7 @@ local function replace_snippets()
|
||||
vim.notify('Failed to write: ' .. target_path, vim.log.levels.ERROR)
|
||||
end
|
||||
end
|
||||
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
|
||||
-- Run the function
|
||||
replace_snippets()
|
||||
|
||||
Reference in New Issue
Block a user