diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2019-09-02 14:10:26 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-09-03 14:59:43 -0300 |
commit | 0a5c5eee15072b712d0cee4cce8d642d1177ff76 (patch) | |
tree | d5af50a42837542a9a53314944b8f920be99f995 /src | |
parent | 62a7c4f5fbb727b2509fc6d91fb6943111d30cbd (diff) | |
download | luarocks-0a5c5eee15072b712d0cee4cce8d642d1177ff76.tar.gz luarocks-0a5c5eee15072b712d0cee4cce8d642d1177ff76.tar.bz2 luarocks-0a5c5eee15072b712d0cee4cce8d642d1177ff76.zip |
fs: fix Lua wrapper for interactive mode
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/fs/unix.lua | 2 | ||||
-rw-r--r-- | src/luarocks/fs/win32.lua | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/luarocks/fs/unix.lua b/src/luarocks/fs/unix.lua index 92a2dd91..164ec75d 100644 --- a/src/luarocks/fs/unix.lua +++ b/src/luarocks/fs/unix.lua | |||
@@ -99,7 +99,7 @@ function unix.wrap_script(script, target, deps_mode, name, version, ...) | |||
99 | fs.Q(dir.path(cfg.variables["LUA_BINDIR"], cfg.lua_interpreter)), | 99 | fs.Q(dir.path(cfg.variables["LUA_BINDIR"], cfg.lua_interpreter)), |
100 | "-e", | 100 | "-e", |
101 | fs.Q(table.concat(luainit, ";")), | 101 | fs.Q(table.concat(luainit, ";")), |
102 | script and fs.Q(script) or "", | 102 | script and fs.Q(script) or [[$([ "$*" ] || echo -i)]], |
103 | ... | 103 | ... |
104 | } | 104 | } |
105 | 105 | ||
diff --git a/src/luarocks/fs/win32.lua b/src/luarocks/fs/win32.lua index 71b22e35..b9404a73 100644 --- a/src/luarocks/fs/win32.lua +++ b/src/luarocks/fs/win32.lua | |||
@@ -167,12 +167,15 @@ function win32.wrap_script(script, target, deps_mode, name, version, ...) | |||
167 | fs.Qb(dir.path(cfg.variables["LUA_BINDIR"], cfg.lua_interpreter)), | 167 | fs.Qb(dir.path(cfg.variables["LUA_BINDIR"], cfg.lua_interpreter)), |
168 | "-e", | 168 | "-e", |
169 | fs.Qb(table.concat(luainit, ";")), | 169 | fs.Qb(table.concat(luainit, ";")), |
170 | script and fs.Qb(script) or "", | 170 | script and fs.Qb(script) or "%I%", |
171 | ... | 171 | ... |
172 | } | 172 | } |
173 | 173 | ||
174 | wrapper:write("@echo off\r\n") | 174 | wrapper:write("@echo off\r\n") |
175 | wrapper:write("setlocal\r\n") | 175 | wrapper:write("setlocal\r\n") |
176 | if not script then | ||
177 | wrapper:write([[IF "%*"=="" (set I=-i) ELSE (set I=)]] .. "\r\n") | ||
178 | end | ||
176 | wrapper:write("set "..fs.Qb("LUAROCKS_SYSCONFDIR="..cfg.sysconfdir) .. "\r\n") | 179 | wrapper:write("set "..fs.Qb("LUAROCKS_SYSCONFDIR="..cfg.sysconfdir) .. "\r\n") |
177 | wrapper:write(table.concat(argv, " ") .. " %*\r\n") | 180 | wrapper:write(table.concat(argv, " ") .. " %*\r\n") |
178 | wrapper:write("exit /b %ERRORLEVEL%\r\n") | 181 | wrapper:write("exit /b %ERRORLEVEL%\r\n") |