瀏覽代碼

add build on windows plateform

pull/342/head
Guillaume Vincent 8 年之前
父節點
當前提交
5c76b078d2
共有 5 個檔案被更改,包括 30 行新增7 行删除
  1. +1
    -6
      .gitignore
  2. 二進制
      images/icon.ico
  3. 二進制
      images/icon.png
  4. +2
    -1
      package.json
  5. +27
    -0
      zip.py

+ 1
- 6
.gitignore 查看文件

@@ -1,7 +1,2 @@
node_modules
/LessPass-win32-x64/
/LessPass-linux-x64/
/LessPass-mas-x64/
/LessPass-win32-ia32/
/LessPass-linux-ia32/
/LessPass-darwin-x64/
build

二進制
images/icon.ico 查看文件

Before After

二進制
images/icon.png 查看文件

Before After
Width: 280  |  Height: 280  |  Size: 11 KiB

+ 2
- 1
package.json 查看文件

@@ -6,15 +6,16 @@
"productName": "LessPass",
"scripts": {
"build": "gulp",
"build:windows": "electron-packager ./ --platform=win32 --arch=x64 --icon=images/icon.ico --ignore=node_modules --ignore=build --overwrite && python zip.py",
"start": "electron ."
},

"author": "Guillaume Vincent <guillaume@oslab.fr>",
"bugs": {
"url": "https://github.com/electron/electron-quick-start/issues"
},
"homepage": "https://github.com/electron/electron-quick-start#readme",
"devDependencies": {
"electron-packager": "^7.2.0",
"electron-prebuilt": "^1.2.0",
"gulp": "^3.9.1"
},


+ 27
- 0
zip.py 查看文件

@@ -0,0 +1,27 @@
import os
import shutil


def get_version():
with open('package.json') as f:
for line in f.readlines():
if '"version":' in line:
return line.split('"')[-2]


windows_folder = 'LessPass-win32-x64'
output_filename = 'LessPass-v%s.win32-x64' % get_version()
if os.path.exists(windows_folder):
print('zip %s into %s.zip file' % (windows_folder, output_filename))
shutil.make_archive(output_filename, 'zip', windows_folder)
print('remove %s folder' % windows_folder)
shutil.rmtree(windows_folder)

build_folder = 'build'
if os.path.exists(build_folder):
shutil.rmtree(build_folder)
os.makedirs(build_folder)

zip_name = '%s.zip' % output_filename
print('move %s into build folder' % zip_name)
shutil.move(zip_name, os.path.join(build_folder, zip_name))

Loading…
取消
儲存