Skip to content

Commit 0331bff

Browse files
committed
🚸 Add texluajitp
1 parent 5599ed4 commit 0331bff

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

bin/texluajitp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env -S luajittex --luaonly
2+
local string = require "string"
3+
local package = require "package"
4+
local version = string.gsub(_VERSION, ".* ", "")
5+
local path = package.path
6+
local cpath = package.cpath
7+
package.path = package.path .. ";/usr/share/lua/" .. version .. "/?.lua;/usr/share/lua/" .. version .. "/?/init.lua"
8+
local ext = string.match(package.cpath, '([^.]+)[;|$]')
9+
package.cpath = package.cpath .. ";/usr/lib/lua/" .. version .. "/?." .. ext
10+
11+
local prompt = require "prompt"
12+
prompt.name = 'texlua'
13+
prompt.prompts = { '> ', '>> ' }
14+
prompt.colorize = true
15+
prompt.history = os.getenv('HOME') .. '/.lua_history'
16+
17+
for _, name in ipairs { os.getenv('HOME') .. '/.luaprc.lua',
18+
os.getenv('HOME') .. '/.config/luaprc.lua' } do
19+
local f = io.open(name, "r")
20+
if f ~= nil then
21+
io.close(f)
22+
23+
chunk, message = loadfile(name)
24+
25+
if chunk then
26+
chunk()
27+
else
28+
print(message)
29+
end
30+
31+
break
32+
end
33+
end
34+
35+
package.path = path
36+
package.cpath = cpath
37+
prompt.enter()

template.rockspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ build = {
4343
bin = {
4444
"bin/nvimp",
4545
"bin/texluap",
46+
"bin/texluajitp",
4647
"bin/pandocp",
4748
"bin/neomuttp"
4849
},

0 commit comments

Comments
 (0)