Skip to content

Commit c54add2

Browse files
committed
merged pk-tools as a subtree to pk-tools
2 parents 0b904a5 + 63e2743 commit c54add2

File tree

96 files changed

+21783
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+21783
-0
lines changed

Diff for: pk-tools/.gitignore

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
*~
2+
.*~
3+
\#*\#
4+
.\#*\#
5+
6+
.DS_Store
7+
._.DS_Store
8+
.project
9+
.settings
10+
.directory
11+
12+
*.kdevelop.*
13+
*.kdevelop
14+
*.kdevses
15+
*.kdev4
16+
/Doxyfile
17+
/tags
18+
19+
nohup.out
20+
*.log
21+
.idea
22+
*.iml
23+
24+
*.kate_swp
25+
tmp/*
26+
*.kate_swps

Diff for: pk-tools/bin/pk-call-lua-module

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#! /usr/bin/env pk-lua-interpreter
2+
3+
--------------------------------------------------------------------------------
4+
-- pk-call-lua-module: run arbitrary function from Lua module in pk environment
5+
--------------------------------------------------------------------------------
6+
7+
pcall(require, 'luarocks.require') -- Ignoring errors
8+
9+
--------------------------------------------------------------------------------
10+
11+
require 'lua-nucleo.module'
12+
require 'lua-nucleo.strict'
13+
14+
require = import 'lua-nucleo/require_and_declare.lua' { 'require_and_declare' }
15+
16+
--------------------------------------------------------------------------------
17+
18+
import 'pk-core/common_logging.lua' { 'create_common_stdout_logging' } ()
19+
20+
--------------------------------------------------------------------------------
21+
22+
local extra_path = assert(select(1, ...), "missing extra_path")
23+
local module_name = assert(select(2, ...), "missing module_name")
24+
local function_name = assert(select(3, ...), "missing function_name")
25+
26+
if extra_path ~= "" then
27+
if extra_path:sub(#extra_path) ~= ";" then
28+
extra_path = extra_path .. ";"
29+
end
30+
31+
if package.path:sub(#package.path) ~= ";" then
32+
package.path = package.path .. ";"
33+
end
34+
35+
package.path = extra_path .. package.path
36+
end
37+
38+
local module = require(module_name)
39+
assert(
40+
module[function_name],
41+
"module does not export specified function"
42+
)(select(4, ...))

0 commit comments

Comments
 (0)