From be2d4d8267dd75d11d292ceae816b6fcdc7cb938 Mon Sep 17 00:00:00 2001 From: gpcf Date: Mon, 22 Apr 2024 14:52:57 +0200 Subject: Add backup to git script, as well as the ability to read legacy file format --- gitexporter.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'gitexporter.lua') diff --git a/gitexporter.lua b/gitexporter.lua index 27384e9..c2af114 100644 --- a/gitexporter.lua +++ b/gitexporter.lua @@ -38,10 +38,13 @@ function node_file(env, pos) return base.."/"..pos..".lua" end - - -tb = serialize_lib.read_table_from_file(inpath.."/advtrains_atlatc.ls") - +v4path = inpath.."/advtrains_atlatc.ls" +tb = {} +if lfs.attributes(v4path) then + tb = serialize_lib.read_table_from_file(v4path) +else + tb = dofile(inpath.."/advtrains_luaautomation") +end ensure_dir(base_path) for env, data in pairs(tb.envs) do -- cgit v1.2.3