Skip to content

Commit e7cbdb5

Browse files
committed
Show examples folder when unitron is run from ram
When unitron is run directly from /ram/cart, the examples folder is not properly shown after user clicks "open examples" button.
1 parent 8304cea commit e7cbdb5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

gui/gui.lua

+7-1
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,16 @@ function _init()
326326
y = 105
327327
}
328328
function examples_btn:click()
329+
local dir = env().corun_program or env().prog_name
330+
if dir == "/ram/cart/main.lua" then
331+
dir = "/ram/cart"
332+
end
333+
dir = dir .. "/examples"
334+
329335
create_process(
330336
"/system/apps/filenav.p64",
331337
{
332-
argv = { env().prog_name .. "/examples/" },
338+
argv = { dir },
333339
}
334340
)
335341
end

0 commit comments

Comments
 (0)