Преглед изворни кода

add build on windows plateform

pull/342/head
Guillaume Vincent пре 8 година
родитељ
комит
5c76b078d2
5 измењених фајлова са 30 додато и 7 уклоњено
  1. +1
    -6
      .gitignore
  2. BIN
      images/icon.ico
  3. BIN
      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

BIN
images/icon.ico Прегледај датотеку

Before After

BIN
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…
Откажи
Сачувај