import os

version = "v0.01"

snap = ""
with open('snap/dist/snap.svg-min.js', 'r') as file:
    snap+=file.read()

with open('editor.php', 'r') as file:
    editor=file.read()

inter = ""
parts = editor.replace("//#beg", "//#").replace("//#end", "//#").split("//#");	
for i in range(1,len(parts),2):
	inter += parts[i]

if not os.path.exists("lib/" + version):
    os.makedirs("lib/" + version)	

with open('lib/v0.01/lib.js', 'w') as file:
    file.write(snap + inter)

print("done")