Skip to content

Commit

Permalink
Show examples folder when unitron is run from ram
Browse files Browse the repository at this point in the history
When unitron is run directly from /ram/cart, the examples folder is not
properly shown after user clicks "open examples" button.
  • Loading branch information
elgopher committed Dec 5, 2024
1 parent 8304cea commit e7cbdb5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gui/gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,16 @@ function _init()
y = 105
}
function examples_btn:click()
local dir = env().corun_program or env().prog_name
if dir == "/ram/cart/main.lua" then
dir = "/ram/cart"
end
dir = dir .. "/examples"

create_process(
"/system/apps/filenav.p64",
{
argv = { env().prog_name .. "/examples/" },
argv = { dir },
}
)
end
Expand Down

0 comments on commit e7cbdb5

Please sign in to comment.