Skip to content

Commit 731a43e

Browse files
committed
Fix line endings of wsapi.cgi
Using CRLF causes Linux to fail with `/usr/bin/wsapi.cgi: bad interpreter: /usr/bin/lua^M: no such file or directory`
1 parent 0643db3 commit 731a43e

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

‎src/launcher/wsapi.cgi‎

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
#!/usr/bin/lua
2-
3-
-- Generic WSAPI CGI launcher, extracts application to launch
4-
-- either from the command line (use #!wsapi in the script)
5-
-- or from SCRIPT_FILENAME/PATH_TRANSLATED
6-
7-
pcall(require, "luarocks.require")
8-
9-
local common = require "wsapi.common"
10-
local cgi = require "wsapi.cgi"
11-
12-
local arg_filename = (...)
13-
14-
local function wsapi_loader(wsapi_env)
15-
local path, file, modname, ext =
16-
common.find_module(wsapi_env, arg_filename, "wsapi.cgi", { "SCRIPT_FILENAME", "PATH_TRANSLATED" })
17-
if not path then
18-
error({ 404, "Resource " .. wsapi_env.SCRIPT_NAME .. " not found" })
19-
end
20-
wsapi.app_path = path
21-
local app = common.load_wsapi(path, file, modname, ext)
22-
wsapi_env.APP_PATH = path
23-
return app(wsapi_env)
24-
end
25-
26-
cgi.run(wsapi_loader)
1+
#!/usr/bin/lua
2+
3+
-- Generic WSAPI CGI launcher, extracts application to launch
4+
-- either from the command line (use #!wsapi in the script)
5+
-- or from SCRIPT_FILENAME/PATH_TRANSLATED
6+
7+
pcall(require, "luarocks.require")
8+
9+
local common = require "wsapi.common"
10+
local cgi = require "wsapi.cgi"
11+
12+
local arg_filename = (...)
13+
14+
local function wsapi_loader(wsapi_env)
15+
local path, file, modname, ext =
16+
common.find_module(wsapi_env, arg_filename, "wsapi.cgi", { "SCRIPT_FILENAME", "PATH_TRANSLATED" })
17+
if not path then
18+
error({ 404, "Resource " .. wsapi_env.SCRIPT_NAME .. " not found" })
19+
end
20+
wsapi.app_path = path
21+
local app = common.load_wsapi(path, file, modname, ext)
22+
wsapi_env.APP_PATH = path
23+
return app(wsapi_env)
24+
end
25+
26+
cgi.run(wsapi_loader)

0 commit comments

Comments
 (0)