From bc10c737cebba32d738e16fb2716b410e0a6b0c3 Mon Sep 17 00:00:00 2001 From: PLAZMAMA Date: Tue, 7 Jan 2025 23:53:15 -0500 Subject: [PATCH 1/3] Improve documentation on common errors --- README.md | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ae2c3f6..cd46d39 100644 --- a/README.md +++ b/README.md @@ -74,15 +74,37 @@ luarocks test spec/path_to_file.lua --local busted spec/path_to_file.lua ``` -If you see an error like `module 'busted.runner' not found`: +### Common Errors + +#### "module "busted.runner" not found" or "pl.path requires LuaFileSystem" Error + +If you see one of the errors like the above fix it by +runing the following command the following command: ```bash eval $(luarocks path --no-bin) ``` -For this to work you need to have Lua 5.1 set as your default version for -luarocks. If that's not the case you can pass `--lua-version 5.1` to all the -luarocks commands above. +#### "sh: nlua: command not found" Error + +If the error above occurs do[^1]: + +##### Linux/Max + +Run the following command: +```bash +export PATH=$PATH:~/.luarocks/bin +``` + +##### Windows + +See the following guide to a variable to the PATH: [add to PATH][add-env-vars-windows]. + +> [!Note] +> For local testing to work you need to have Lua 5.1 set as your default version for +> luarocks. If that's not the case you can pass `--lua-version 5.1` to all the +> luarocks commands above, or set lua version 5.1 globally by running +> `luarocks config --scope system lua_version 5.1`. [rockspec-format]: https://github.com/luarocks/luarocks/wiki/Rockspec-format [luarocks]: https://luarocks.org @@ -91,3 +113,4 @@ luarocks commands above. [busted]: https://lunarmodules.github.io/busted/ [nlua]: https://github.com/mfussenegger/nlua [use-this-template]: https://github.com/new?template_name=nvim-lua-plugin-template&template_owner=nvim-lua +[add-env-vars-windows]: https://answers.microsoft.com/en-us/windows/forum/all/adding-path-variable/97300613-20cb-4d85-8d0e-cc9d3549ba23 From 0ca53e8cf6901063e5fcc78c9dc9defdeca16af9 Mon Sep 17 00:00:00 2001 From: PLAZMAMA Date: Tue, 7 Jan 2025 23:54:23 -0500 Subject: [PATCH 2/3] update footnote --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cd46d39..9639729 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,8 @@ Running tests requires either to be installed[^1]. -[^1]: The test suite assumes that `nlua` has been installed - using luarocks into `~/.luarocks/bin/`. +[^1]: The test suite assumes that `nlua` has + been added to the PATH. You can then run: From 13fd65ff2bbb3cadddf9490cb3ba324bb6f5e0b4 Mon Sep 17 00:00:00 2001 From: PLAZMAMA Date: Wed, 8 Jan 2025 00:00:55 -0500 Subject: [PATCH 3/3] Improve common errors section formatting --- README.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9639729..43e2aaf 100644 --- a/README.md +++ b/README.md @@ -76,27 +76,24 @@ busted spec/path_to_file.lua ### Common Errors -#### "module "busted.runner" not found" or "pl.path requires LuaFileSystem" Error - -If you see one of the errors like the above fix it by +If you encounter the `module 'busted.runner' not found` +or `pl.path requires LuaFileSystem` errors, fix it by runing the following command the following command: ```bash eval $(luarocks path --no-bin) ``` -#### "sh: nlua: command not found" Error - -If the error above occurs do[^1]: +If you encounter `sh: nlua: command not found` error the error above occurs do[^1]: -##### Linux/Max +#### Linux/Max Run the following command: ```bash export PATH=$PATH:~/.luarocks/bin ``` -##### Windows +#### Windows See the following guide to a variable to the PATH: [add to PATH][add-env-vars-windows].