- Install [[podman#^7cfae6|Podman Desktop]]
- Open [PowerShell](…/Microsoft PowerShell/) and navigate to the parent directory of the new project’s directory, e.g.
mkdir $HOME/src
cd $HOME/src
- Create a new Muddler project in the “TemplateProject” folder:
podman run --pull always --rm -it -v ${PWD}:/src -w /src demonnic/muddler --default
- Rename the “TemplateProject” folder to something more appropriate, e.g.
ren TemplateProject MyFirstMuddle
- In Mudlet, create/open a profile that you use for development only, and install the Muddler package in order to facilitate automatic reloading of the package you are developing:
lua installPackage("https://github.com/demonnic/muddler/releases/download/1.1.0/Muddler.mpackage")
- Create a script in the Mudlet profile you use for development that uses Muddler to automatically reload the (development) package from its directory, e.g.
local function killMDK()
for pkgName, _ in pairs(package.loaded) do
if pkgName:find("MDK") then
debugc("Uncaching lua package " .. pkgName)
package.loaded[pkgName] = nil
end
end
end
local function create_helper()
if MDKhelper then MDKhelper:stop() end
MDKhelper = Muddler:new({
path = "C:/Users/USERNAME/src/MyFirstMuddle",
postremove = killMDK,
})
end
if not MDKhelper then
registerAnonymousEventHandler("sysLoadEvent", create_helper)
end
- Make sure to use forward slashes (
/
) instead of backslashes (\
) in the path
- Watch for code changes and build continously:
cd $HOME/src/MyFirstMuddle
podman run --pull always --rm -it -v ${PWD}:/MyFirstMuddle -w /MyFirstMuddle demonnic/muddler -w
- The package should now get installed in the Mudlet profile.
- Edit the code using your favorite code editor.