4 Star 2 Fork 0

Gitee 极速下载/emojicode

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/emojicode/emojicode
克隆/下载
dist.py 1.82 KB
一键复制 编辑 原始数据 按行查看 历史
thbwd 提交于 5年前 . 🟩 Update version and docs
import platform
import shutil
import os
import sys
import subprocess
version = "1.0-beta.2"
packages = ["s", "files", "sockets", "testtube", "json"]
source = os.path.dirname(os.path.realpath(__file__))
dist_name = "Emojicode-{0}-{1}-{2}".format(version, platform.system(),
platform.machine())
path = os.path.abspath(dist_name)
def copy_packages(destination, source):
for package in packages:
dir_path = os.path.join(destination, package)
make_dir(dir_path)
shutil.copy2(os.path.join(package.encode('utf-8'), "🏛".encode('utf-8')), dir_path.encode('utf-8'))
shutil.copy2(os.path.join(package, "lib" + package + ".a"), dir_path)
def make_dir(path):
if not os.path.exists(path):
os.makedirs(path)
def copy_header(*args):
make_dir(os.path.join(path, "include", *args[:-1]))
shutil.copy2(os.path.join(source, *args),
os.path.join(path, "include", *args))
if __name__ == "__main__":
make_dir(path)
shutil.copy2(os.path.join(source, "install.sh"), path)
shutil.copy2(os.path.join("Compiler", "emojicodec"), path)
copy_header("runtime", "Runtime.h")
copy_header("s", "Data.h")
copy_header("s", "String.h")
dir_path = os.path.join(path, "packages", "runtime")
make_dir(dir_path)
shutil.copy2(os.path.join("runtime", "libruntime.a"), dir_path)
copy_packages(os.path.join(path, "packages"),
os.path.join(source, "headers"))
if len(sys.argv) > 1 and sys.argv[1] == "archive":
archive_name = shutil.make_archive(dist_name, "gztar", os.getcwd(), dist_name)
print(archive_name, end='')
if len(sys.argv) > 1 and sys.argv[1] == "install":
bash = "cd " + path + " && yes | " + os.path.join(path, "install.sh")
subprocess.run(["bash", "-c", bash])
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/mirrors/emojicode.git
git@gitee.com:mirrors/emojicode.git
mirrors
emojicode
emojicode
master

搜索帮助