From cadda4422bd7fab37e8caa9476b91e2ca14eb0fa Mon Sep 17 00:00:00 2001 From: Tohkai Date: Fri, 9 Jan 2026 14:16:49 +0100 Subject: [PATCH] Added devel/export-dt-linux which uses the export-dt-init script to export the current memory layout to the right linux path with the correct name for DT --- devel/export-dt-linux.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 devel/export-dt-linux.lua diff --git a/devel/export-dt-linux.lua b/devel/export-dt-linux.lua new file mode 100644 index 000000000..1fc543868 --- /dev/null +++ b/devel/export-dt-linux.lua @@ -0,0 +1,17 @@ +-- uses the dwarf therapist export script to generate a layout in the right directory under linux + +dfhack.run_command('export-dt-ini') + +local home = os.getenv("HOME") +local vstring = dfhack.getDFVersion() +local platform = vstring:match("(%S+)%s*$") +local filename = (string.sub(vstring, 1, 8) .. "-" .. platform .. "_linux64.ini") + +local src = assert(io.open("therapist.ini", "r")) +local dest = assert(io.open(home .. "/.local/share/dwarftherapist/memory_layouts/linux/" .. filename , "w")) + +dest:write(src:read("*all")) +src:close() +dest:close() + +os.remove("therapist.ini") \ No newline at end of file