Is there a better way to require file from relative path in lua

前端 未结 1 2013
陌清茗
陌清茗 2020-12-07 22:37

My directory structure looks like this:

|-- ball.lua
|-- entity.lua
|-- test
    `-- ball_test.lua

I\'m using the following code in test/ba

1条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 23:13

    package.path = package.path .. ";../?.lua"
    

    will work for both.

    0 讨论(0)
提交回复
热议问题