-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc7203f
commit 9ba06fc
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ nibbler.log | |
releases/* | ||
concat.py | ||
leelaz_opencl_tuning | ||
electron_zipped/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import json, os, shutil, zipfile | ||
|
||
with open("package.json") as f: | ||
version = json.load(f)["version"] | ||
|
||
# Location of zipped electron distributions... | ||
|
||
linux_electron = "electron_zipped/electron-v5.0.3-linux-x64.zip" | ||
windows_electron = "electron_zipped/electron-v5.0.3-win32-x64.zip" | ||
|
||
# Setup directories... | ||
|
||
linux_dir = "./dist/nibbler-{}-linux".format(version) | ||
windows_dir = "./dist/nibbler-{}-windows".format(version) | ||
|
||
linux_app_dir = os.path.join(linux_dir, "resources/app") | ||
windows_app_dir = os.path.join(windows_dir, "resources/app") | ||
|
||
os.makedirs(linux_app_dir, exist_ok = True) | ||
os.makedirs(windows_app_dir, exist_ok = True) | ||
|
||
# Source and other technical files... | ||
|
||
useful_files = [file for file in os.listdir() if file.endswith(".js") or file.endswith(".html") or file.endswith(".css") or file == "package.json"] | ||
|
||
for file in useful_files: | ||
shutil.copy(file, linux_app_dir) | ||
shutil.copy(file, windows_app_dir) | ||
|
||
# Folders... | ||
|
||
folders = ["modules", "pieces"] | ||
|
||
for folder in folders: | ||
shutil.copytree(folder, os.path.join(linux_app_dir, folder)) | ||
shutil.copytree(folder, os.path.join(windows_app_dir, folder)) | ||
|
||
# config.example.json - to the high level dir, not the app dir | ||
|
||
shutil.copy("config.example.json", linux_dir) | ||
shutil.copy("config.example.json", windows_dir) | ||
|
||
# Extract Electron | ||
|
||
z = zipfile.ZipFile(linux_electron, "r") | ||
z.extractall(linux_dir) | ||
z.close() | ||
|
||
z = zipfile.ZipFile(windows_electron, "r") | ||
z.extractall(windows_dir) | ||
z.close() | ||
|
||
# Rename Electron | ||
|
||
os.rename(os.path.join(linux_dir, "electron"), os.path.join(linux_dir, "nibbler")) | ||
os.rename(os.path.join(windows_dir, "electron.exe"), os.path.join(windows_dir, "nibbler.exe")) |