87
88
89
90
91
92
93
94
95
96
|
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
+
+
+
+
+
+
+
+
+
+
+
+
|
hZip.write("grammalecte-js/graphspell/_dictionaries/"+sf, sAddPath+"grammalecte-js/graphspell/_dictionaries/"+sf)
for sf in os.listdir(spLangPack):
if not os.path.isdir(spLangPack+"/"+sf):
hZip.write(spLangPack+"/"+sf, sAddPath+spLangPack+"/"+sf)
def createNodeJSPackage (sLang):
print("Building for NodeJS")
helpers.createCleanFolder("_build/nodejs/"+sLang)
dir_util.copy_tree("gc_lang/"+sLang+"/nodejs/", "_build/nodejs/"+sLang)
dir_util.copy_tree("grammalecte-js", "_build/nodejs/"+sLang+"/core/grammalecte")
corePack = ""
cliPack = ""
with helpers.cd("_build/nodejs/"+sLang):
corePack = subprocess.check_output("npm pack ./core", shell=True)
with helpers.cd("_build/nodejs/"+sLang+"/cli"):
subprocess.check_output("npm --no-save install ../"+corePack.decode("utf-8").split('\n', 1)[0], shell=True)
with helpers.cd("_build/nodejs/"+sLang):
cliPack = subprocess.check_output("npm pack ./cli", shell=True)
print("Fichiers à distribuer:")
print(" pour le dev: "+corePack.decode("utf-8").split('\n', 1)[0])
print(" pour une installation du client: "+cliPack.decode("utf-8").split('\n', 1)[0])
|