Sublime运行脚本

shell

Build Stytem > New Build Stytem …

1
{    "shell_cmd": "chmod a+x $file && /bin/sh $file"}

ctrl+s 保存 sh.sublime-build

路径: ~/.config/sublime-text-3/Packages/User/sh.sublime-build

执行脚本快捷键 ctrl+b

lua

1
2
3
4
5
6
7
❯wget http://www.lua.org/ftp/lua-5.3.5.tar.gz
❯tar -xvf lua-5.3.5.tar.gz
❯cd lua-5.3.5
❯ make test
src/lua -v
Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio
❯ make install

找到 Lua 源代码目录中的 Makefile找到 INSTALL_TOP 变量的定义,并将其设置为你希望 Lua 安装的路径

/opt/proxy/lua/bin/lua

Sublime提示找不到lua

1
❯ sudo ln -s /opt/proxy/lua/bin/lua  /usr/local/bin/lua

lua

1
{    "cmd": ["lua", "$file"],    "file_regex": "^(?:lua:)?[\t ](...*?):([0-9]*):?([0-9]*)",    "selector": "source.lua"}

luajit

1
{    "cmd": ["luajit", "$file"],    "file_regex": "^(?:lua:)?[\t ](...*?):([0-9]*):?([0-9]*)",    "selector": "source.lua"}

luarocks

https://luarocks.org/

1
2
3
4
$  wget https://luarocks.org/releases/luarocks-3.11.1.tar.gz
$ tar zxpf luarocks-3.11.1.tar.gz
$ cd luarocks-3.11.1
❯ ./configure --prefix=/opt/proxy/luarocks --with-lua=/opt/proxy/lua

Configuring LuaRocks version 3.11.1…

Lua version detected: 5.3
Lua interpreter found: /opt/proxy/lua/bin/lua
lua.h found: /opt/proxy/lua/include/lua.h
unzip found in PATH: /usr/bin

Done configuring.

LuaRocks will be installed at……: /opt/proxy/luarocks
LuaRocks will install rocks at…..: /opt/proxy/luarocks
LuaRocks configuration directory…: /opt/proxy/luarocks/etc/luarocks
Using Lua from…………………: /opt/proxy/lua

  • Type make and make install:
    to install to /opt/proxy/luarocks as usual.
  • Type make bootstrap:
    to install LuaRocks into /opt/proxy/luarocks as a rock.

❯ make -j6

❯ make install >& log &

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
luarocks install luasocket
luarocks install lua-resty-jit-uuid
luarocks install luaunit
luarocks install lua-cjson 2.1.0-1

❯ luarocks list

Rocks installed for Lua 5.4
---------------------------

lua-cjson
2.1.0.10-1 (installed) - /opt/proxy/luarocks/lib/luarocks/rocks-5.4

lua-resty-jit-uuid
0.0.7-2 (installed) - /opt/proxy/luarocks/lib/luarocks/rocks-5.4

luasocket
3.1.0-1 (installed) - /opt/proxy/luarocks/lib/luarocks/rocks-5.4

luaunit
3.4-1 (installed) - /opt/proxy/luarocks/lib/luarocks/rocks-5.4
点击打赏
文章目录
  1. 1. shell
  2. 2. lua
  3. 3. luarocks
载入天数...载入时分秒... ,