Posted 10 October 2017 - 04:56 PM
SO basically, I would like to make a multi-file program that can be put into any directory.
Thing is, it is called with loadfile so the following will not work:
SO let's say I have a script like this:
How could I get the dir of the running file's directory instead of the shell's current path?
Thing is, it is called with loadfile so the following will not work:
fs.getDir(shell.getRunningProgram())
SO let's say I have a script like this:
--IN test.lua
write('DIR: ')
dir = read()
loadfile(fs.combine(dir, 'test.lua'), _G)()
--IN <somedir>/test.lua
dir =
...
print(dir)
How could I get the dir of the running file's directory instead of the shell's current path?