carrus2049 / reaper_SM_tweaker

GNU General Public License v3.0
0 stars 0 forks source link

Error message on every action #5

Closed antonjazzsax closed 4 months ago

antonjazzsax commented 4 months ago

Getting following error message for every type of action, regardless of the marker's context:

API_SM_move_zoom_dep_forward.lua:2: attempt to concatenate a nil value (local 'script_path')

carrus2049 commented 4 months ago

I assume you're on Windows and path delimiter is not handled correctly, I fixed this to the latest commit, plz update and see how it goes!

antonjazzsax commented 4 months ago

Ok, the error message is gone now. So this one seems to be sorted. Great!. Will see, if any other error messages appears along the way

smandrap commented 4 months ago

You can change this:

local script_path = nil
if reaper.GetOS() ==  "Win32" or reaper.GetOS() == "Win64" then
    script_path = debug.getinfo(1).source:match("@?(.*\\)")
else
    script_path = debug.getinfo(1).source:match("@?(.*/)")
end

To

local script_path = debug.getinfo(1).source:match(("@?(.*%s)"):format(package.config:sub(1, 1)))

Where package.config:sub(1, 1) will return the os separator

carrus2049 commented 4 months ago

You can change this:

local script_path = nil
if reaper.GetOS() ==  "Win32" or reaper.GetOS() == "Win64" then
    script_path = debug.getinfo(1).source:match("@?(.*\\)")
else
    script_path = debug.getinfo(1).source:match("@?(.*/)")
end

To

local script_path = debug.getinfo(1).source:match(("@?(.*%s)"):format(package.config:sub(1, 1)))

Where package.config:sub(1, 1) will return the os separator

Well that is brilliant, thanks alot!

antonjazzsax commented 4 months ago

Awesome. Thanks a lot