Skip to content

Commit

Permalink
修正以main.lua为参数启动时,路径计算错误的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Sep 23, 2020
1 parent dc1a5bb commit 57bfae9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main-beta.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local currentPath = debug.getinfo(1, 'S').source:sub(2)
local rootPath = currentPath:gsub('[/\\]*[^/\\]-$', '')
loadfile(rootPath .. '/platform.lua')('script-beta')
loadfile((rootPath == '' and '.' or rootPath) .. '/platform.lua')('script-beta')
local fs = require 'bee.filesystem'
ROOT = fs.path(rootPath)
LANG = LANG or 'en-US'
Expand Down
2 changes: 1 addition & 1 deletion main.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local currentPath = debug.getinfo(1, 'S').source:sub(2)
local rootPath = currentPath:gsub('[/\\]*[^/\\]-$', '')
loadfile(rootPath .. '/platform.lua')('script')
loadfile((rootPath == '' and '.' or rootPath) .. '/platform.lua')('script')
local fs = require 'bee.filesystem'
ROOT = fs.current_path() / rootPath
LANG = LANG or 'en-US'
Expand Down

0 comments on commit 57bfae9

Please sign in to comment.