Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

awk: illegal field $(), name "F" #25

Closed
evanrelf opened this issue Nov 5, 2018 · 10 comments
Closed

awk: illegal field $(), name "F" #25

evanrelf opened this issue Nov 5, 2018 · 10 comments
Labels
bug Something isn't working

Comments

@evanrelf
Copy link

evanrelf commented Nov 5, 2018

From *debug* buffer, after running plug-install:

awk: illegal field $(), name "F"
 input record number 1, file 
 source line number 1

I never get the Done installing plugins message, it just hangs on Installing plugins in background.

It seems the problem appeared in the latest commit (b3801d2). I can run plug-install with no problems on the previous commit (98defec).

My guess is that my version of awk on macOS is different from whatever version you're using on Linux (I have version 20070501 of awk installed on macOS 10.14 Mojave).

@andreyorst
Copy link
Owner

I've thought that awk is more portable. Can you please try to find a proper command for awk that will count / in the string and print it in the format of number_of_slashes the_string. Also if something like GNU awk is available can you please test it too? I have no macOS to test it, sorry.

find . -type f -name "*.kak" | awk -F/ '{print NF-1, $F}' | sort -n | cut -d' ' -f2

Basically this helps to sort output by printing the less nested files first.

@evanrelf
Copy link
Author

evanrelf commented Nov 5, 2018

Installing GNU Awk (version 4.2.1) from Homebrew (brew install gawk) made the awk errors go away, and it seems like plug-install worked because my plugins are working, but the Done installing plugins message never appeared.

I can try experimenting more later today.

@andreyorst
Copy link
Owner

Try this: find . -type f | awk -F/ '{print NF-1, $0}'

@andreyorst
Copy link
Owner

It works for me on freebsd. AFAIK macOS uses the same awk.

Done installing plugins

I've removed the message, because it was showing irrelevant info about plug state if some hooks were running in background.

@evanrelf
Copy link
Author

evanrelf commented Nov 5, 2018

Try this: find . -type f | awk -F/ '{print NF-1, $0}'

That works! This is the output with the default awk command (not GNU Awk):

~/.config/kak/plugins λ find . -type f -name "*.kak" | awk -F/ '{print NF-1, $0}'
3 ./kakoune-number-toggle/rc/number-toggle.kak
2 ./kakoune-surround/surround.kak
3 ./kak-lsp/rc/lsp.kak
3 ./plug.kak/rc/plug.kak
2 ./kakoune-text-objects/text-objects.kak
2 ./kakoune-auto-percent/auto-percent.kak

@andreyorst
Copy link
Owner

Great. I'll fix this in a munite.

andreyorst added a commit that referenced this issue Nov 5, 2018
andreyorst added a commit that referenced this issue Nov 5, 2018
@andreyorst
Copy link
Owner

Should be working now.

@evanrelf
Copy link
Author

evanrelf commented Nov 5, 2018

I've removed the message, because it was showing irrelevant info about plug state if some hooks were running in background.

I hope in the future you add some indicator that plugins were installed successfully. Having the "done" message is reassuring that everything finished.

Is it possible to do something like kak -e 'plug-clean; plug-update; quit' to update plugins as part of an update script? I've been using nvim +PlugClean! +PlugUpgrade +"PlugUpdate --sync" +qa in my update script to update Vim plugins, and I wonder if it's possible to replicate in Kakoune.

@andreyorst
Copy link
Owner

I hope in the future you add some indicator that plugins were installed successfully

#10

Basically in current state this message was shown after the download process of every plugin is done, and pkst-install hooks were ignored. I've decided to disable it, because I've encountered a situation where Ive downloaded plugon and exited Kakoune before it finished building. This needs to be reworked.

Is it possible to do something like kak -e 'plug-clean; plug-update; quit' to update plugins as part of an update script? I've been using nvim +PlugClean! +PlugUpgrade +"PlugUpdate --sync" +qa in my update script to update Vim plugins, and I wonder if it's possible to replicate in Kakoune

Let's have a separate Issue for this?

@evanrelf
Copy link
Author

evanrelf commented Nov 7, 2018

I was just curious, but we can move it to a new issue if it’s a feature you’re open to.

@andreyorst andreyorst added the bug Something isn't working label Nov 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants