nvimdev/dope

lua ./bin/dope help works , but lua ./bin/dope install goes wrong

Coien-rr opened this issue · 12 comments

Runtime Environment
Operating system and version: Ubuntu18.04
Terminal emulator and version: Windows Termmial
lua version 5.4

Current Behavior
when I use : lua ./bin/dope help
everything goes fine

but when I use: lua ./bin/dope install, It produced the following error

lua: /home/ubuntu/.config/nvim/lua/core/cli.lua:54: bad argument #1 to 'for iterator' (table expected, got string)
stack traceback:
[C]: in function 'next'
/home/ubuntu/.config/nvim/lua/core/cli.lua:54: in local 'generate_node'
/home/ubuntu/.config/nvim/lua/core/cli.lua:75: in function 'core.cli.get_all_packages'
/home/ubuntu/.config/nvim/lua/core/cli.lua:94: in function 'core.cli.installer'
/home/ubuntu/.config/nvim/lua/core/cli.lua:121: in function 'core.cli.install'
/home/ubuntu/.config/nvim/lua/core/cli.lua:183: in function </home/ubuntu/.config/nvim/lua/core/cli.lua:182>
./bin/dope:90: in main chunk
[C]: in ?

maybe I need configure something but i have no idea please give me some advise

thank you very much

did you config some packages?

nope, just pure dope😢

wired. does find command works in windows with wsl?

i tried all commands in wsl2(ubuntu18.04) and pure ubuntu18.04, use clean+ install+update produced the same following error

.config/nvim/lua/core/cli.lua:54: bad argument #1 to 'for iterator' (table expected, got string)

but wired, other commands are fine

what output of dope doctor?

sorry!I missed it in the comment, same error also

right .there has something wrong in get all packages function .. but I don't have a win env

😭 that‘s too bad

can make some debug print . first check all packages file read correct.

--- a/lua/core/cli.lua
+++ b/lua/core/cli.lua
@@ -25,6 +25,16 @@ function cli:get_all_packages()
   end
   p:close()

+  for _, item in pairs(pack.repos) do
+    if type(item) == 'table' then
+      for _, v in pairs(item) do
+        print(v)
+      end
+    end
+
+    print(item)
+  end
+
   local lazy_keyword = {
:

I have the same issue on a fresh install of dope, macos,

NVIM v0.8.0
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@Monterey

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.8.0/share/nvim"

Output of dope doctor with your patch:

./bin/dope doctor
glepnir/zephyr-nvim
function: 0x600000e682a0
table: 0x600001568040
glepnir/dashboard-nvim
function: 0x600000e682d0
table: 0x600001568200
nvim-tree/nvim-tree.lua
nvim-tree/nvim-web-devicons
NvimTreeToggle
function: 0x600000e68300
table: 0x6000015682c0
akinsho/nvim-bufferline.lua
nvim-tree/nvim-web-devicons
function: 0x600000e68330
table: 0x600001568340
nvim-telescope/telescope.nvim
table: 0x6000015609c0
Telescope
function: 0x600000e61680
table: 0x600001560980
glepnir/hlsearch.nvim
BufRead
function: 0x600000e616e0
table: 0x600001560ac0
neovim/nvim-lspconfig
table: 0x600001568480
function: 0x6000000681e0
table: 0x6000015683c0
hrsh7th/nvim-cmp
table: 0x600001568600
function: 0x600000e68720
InsertEnter
table: 0x6000015685c0
L3MON4D3/LuaSnip
InsertCharPre
function: 0x600000e68780
table: 0x600001568780
nvim-treesitter/nvim-treesitter
table: 0x600001570080
function: 0x600000e70240
BufRead
:TSUpdate
table: 0x600001570040
/usr/local/bin/lua: /Users/pbaillet/.config/nvim/lua/core/cli.lua:65: bad argument #1 to 'for iterator' (table expected, got string)
stack traceback:
	[C]: in function 'next'
	/Users/pbaillet/.config/nvim/lua/core/cli.lua:65: in local 'generate_node'
	/Users/pbaillet/.config/nvim/lua/core/cli.lua:86: in function 'core.cli.get_all_packages'
	/Users/pbaillet/.config/nvim/lua/core/cli.lua:144: in function 'core.cli.doctor'
	/Users/pbaillet/.config/nvim/lua/core/cli.lua:194: in function </Users/pbaillet/.config/nvim/lua/core/cli.lua:193>
	./bin/dope:90: in main chunk
	[C]: in ?

wired it works fine on my mac

fixed.