summaryrefslogtreecommitdiff
path: root/gitexporter.lua
diff options
context:
space:
mode:
authorgpcf <gpcf@gpcf.eu>2024-04-22 14:52:57 +0200
committergpcf <gpcf@gpcf.eu>2024-04-22 14:52:57 +0200
commitbe2d4d8267dd75d11d292ceae816b6fcdc7cb938 (patch)
tree626a56262b3dc5455903044e1ab252867074e56b /gitexporter.lua
parenta6dd04801f912778a154f9d516c703f0d57aef6a (diff)
downloadadvtrains_gitexporter-be2d4d8267dd75d11d292ceae816b6fcdc7cb938.tar.gz
advtrains_gitexporter-be2d4d8267dd75d11d292ceae816b6fcdc7cb938.tar.bz2
advtrains_gitexporter-be2d4d8267dd75d11d292ceae816b6fcdc7cb938.zip
Add backup to git script, as well as the ability to read legacy file format
Diffstat (limited to 'gitexporter.lua')
-rw-r--r--gitexporter.lua11
1 files changed, 7 insertions, 4 deletions
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