mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-11-14 06:10:10 +00:00
23 lines
559 B
Python
23 lines
559 B
Python
|
#!/usr/bin/python
|
||
|
import shutil
|
||
|
import sys
|
||
|
from pathlib import Path
|
||
|
|
||
|
external = ["false", "external", "no", "n"]
|
||
|
|
||
|
with open("embed.go", "w") as f:
|
||
|
choice = ""
|
||
|
try:
|
||
|
choice = sys.argv[1]
|
||
|
except IndexError:
|
||
|
pass
|
||
|
folder = Path("embed")
|
||
|
if choice in external:
|
||
|
embed = False
|
||
|
shutil.copy(folder / "external.go", "embed.go")
|
||
|
print("Embedding disabled. \"data\" must be placed alongside the executable.")
|
||
|
else:
|
||
|
shutil.copy(folder / "internal.go", "embed.go")
|
||
|
print("Embedding enabled.")
|
||
|
|