snapshot before merge
This commit is contained in:
1 parent
2b3b2850f9
commit
21fc65b3ae
145 files changed
+9786
-59
No files matched your search
@@ -0,0 +1,23 @@
|
||||
# Read helpers.go and append its functions to tgcore.go
|
||||
helpers_path = r"E:\GitHub\blog\bot-go\internal\helpers\helpers.go"
|
||||
tgcore_path = r"E:\GitHub\blog\bot-go\internal\tgcore\tgcore.go"
|
||||
|
||||
with open(helpers_path, "rb") as f:
|
||||
helpers = f.read().decode("utf-8")
|
||||
|
||||
with open(tgcore_path, "rb") as f:
|
||||
tgcore = f.read().decode("utf-8")
|
||||
|
||||
# Strip package declaration and imports from helpers
|
||||
helpers = helpers.replace("package helpers\n", "")
|
||||
# Remove import block
|
||||
import_end = helpers.find(")\n")
|
||||
if import_end > 0:
|
||||
helpers = helpers[import_end+2:]
|
||||
|
||||
# Add helper functions to end of tgcore
|
||||
tgcore = tgcore.rstrip() + "\n\n// === Inlined from helpers ===\n" + helpers
|
||||
|
||||
with open(tgcore_path, "wb") as f:
|
||||
f.write(tgcore.encode("utf-8"))
|
||||
print("helpers inlined into tgcore")
|
||||
Reference in new issue
Block a user