This commit is contained in:
13
build.py
13
build.py
@ -4,6 +4,7 @@ import tempfile
|
||||
import hashlib
|
||||
import time
|
||||
import zipfile
|
||||
import importlib.util
|
||||
|
||||
current_dir = os.getcwd()
|
||||
|
||||
@ -23,6 +24,18 @@ def buildPack(dir, version):
|
||||
current_path = os.path.join(current_dir, str(version))
|
||||
copyFiles(current_path, dir)
|
||||
|
||||
buildScript = os.path.join(dir, "build.py")
|
||||
if (os.path.isfile(buildScript)):
|
||||
old_cwd = os.getcwd()
|
||||
os.chdir(dir)
|
||||
|
||||
spec = importlib.util.spec_from_file_location('dynamic_module', buildScript)
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
|
||||
os.chdir(old_cwd)
|
||||
os.remove(buildScript)
|
||||
|
||||
zip_folder(dir, current_path + ".zip")
|
||||
# shutil.make_archive(current_path, "zip", dir)
|
||||
current_path = current_path + ".zip"
|
||||
|
||||
Reference in New Issue
Block a user