skywind3000 / skywind3000/z.lua

Lua interpreter path in `ZLUA_LUAEXE` is not correct

Open
#90 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
3.1k
Forks
148
PR merge metrics
No merged PRs in 30d

Description

I installed lua in global by using sudo apt install lua5.2. After that, lua locates in /usr/bin/lua.
I initialize the script by using eval "$(lua /path/to/z.lua --init bash once enhanced)" as mentioned in readme. The output of lua script is,

ZLUA_SCRIPT="/mnt/c/Users/bingzhang/source/repos/deploy/roles/common/files/bash/.bash/plugins/z.lua"
ZLUA_LUAEXE="/home/david/.local/bin/lua"

_zlua() {
        local arg_mode=""

ZLUA_LUAEXE variable is definitely not correct. However, if I change the initialize command to

eval "$(`which lua` /path/to/z.lua --init bash once enhanced)"

Then, the output seems correct,

ZLUA_SCRIPT="/mnt/c/Users/bingzhang/source/repos/deploy/roles/common/files/bash/.bash/plugins/z.lua"
ZLUA_LUAEXE="/usr/bin/lua"

_zlua() {
        local arg_mode=""

I checked with the lua script, and found that this is caused by the wrong output of os.interpreter(). I have no experience in lua and do not know why this happened.

Is there any problem with the z.lua itself? Or is it a good idea to modify the README.md a little bit in order to get a correct output?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting z.lua's os.interpreter() behavior and the initialization path that produces ZLUA_LUAEXE. Compare the documented README.md command with the which lua variant, then verify that the generated value is /usr/bin/lua for the reported installation. If the command is intentionally different, update README.md to show the working form.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, lua
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.