From 1b608a994f51751c4262108564d7e7d044b8ceb4 Mon Sep 17 00:00:00 2001 From: gaoshuaixing Date: Mon, 2 Nov 2020 16:52:39 +0800 Subject: [PATCH] update --- .travis.yml | 14 -------------- LICENSE.md | 1 - {main => app}/lanucher.js | 0 {asset => app/public}/images/loding.gif | Bin index.html => app/public/loading.html | 2 +- appveyor.yml | 16 ---------------- main.js | 15 ++++----------- 7 files changed, 5 insertions(+), 43 deletions(-) delete mode 100644 .travis.yml delete mode 100644 LICENSE.md rename {main => app}/lanucher.js (100%) rename {asset => app/public}/images/loding.gif (100%) rename index.html => app/public/loading.html (89%) delete mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 994b4c3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ - -language: node_js -node_js: - - '8' - - '10' - - '12' -before_install: - - npm i npminstall -g -install: - - npminstall -script: - - npm run ci -after_script: - - npminstall codecov && codecov diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 83381e3..0000000 --- a/LICENSE.md +++ /dev/null @@ -1 +0,0 @@ -GNU General Public License \ No newline at end of file diff --git a/main/lanucher.js b/app/lanucher.js similarity index 100% rename from main/lanucher.js rename to app/lanucher.js diff --git a/asset/images/loding.gif b/app/public/images/loding.gif similarity index 100% rename from asset/images/loding.gif rename to app/public/images/loding.gif diff --git a/index.html b/app/public/loading.html similarity index 89% rename from index.html rename to app/public/loading.html index a46e498..91f2f25 100644 --- a/index.html +++ b/app/public/loading.html @@ -16,7 +16,7 @@
- +
\ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index aea9477..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,16 +0,0 @@ -environment: - matrix: - - nodejs_version: '8' - - nodejs_version: '10' - - nodejs_version: '12' - -install: - - ps: Install-Product node $env:nodejs_version - - npm i npminstall && node_modules\.bin\npminstall - -test_script: - - node --version - - npm --version - - npm run test - -build: off diff --git a/main.js b/main.js index 3e5ba08..5b9f6a4 100644 --- a/main.js +++ b/main.js @@ -1,8 +1,7 @@ const {app, BrowserWindow, Menu, shell} = require('electron') const path = require('path') -const glob = require('glob') const getPort = require('get-port') -const eggLauncher = require('./main/lanucher') +const eggLauncher = require('./app/lanucher') // glogger global.GLOGGER = require('electron-log') @@ -27,7 +26,7 @@ for (let i = 0; i < process.argv.length; i++) { } GLOGGER.info('options', options); -if (process.mas) app.setName('box') +if (process.mas) app.setName('electron-egg') app.on('web-contents-created', (e, webContents) => { webContents.on('new-window', (event, url) => { @@ -39,7 +38,7 @@ app.on('web-contents-created', (e, webContents) => { async function createWindow () { MAIN_WINDOW = new BrowserWindow({ width: 800, - height: 800, + height: 600, minWidth: 800, minHeight: 600, webPreferences: { @@ -61,7 +60,7 @@ async function createWindow () { } // loding页 - MAIN_WINDOW.loadURL(path.join('file://', __dirname, '/index.html')) + MAIN_WINDOW.loadURL(path.join('file://', __dirname, '/public/loading.html')) // egg服务 setTimeout(function(){ @@ -92,7 +91,6 @@ async function startServer (options) { } async function initialize () { - loadDemos() app.whenReady().then(() => { createWindow() app.on('activate', function () { @@ -110,9 +108,4 @@ async function initialize () { }) } -function loadDemos () { - let files = glob.sync(path.join(__dirname, 'main/**/*.js')) - files.forEach((file) => { require(file) }) -} - initialize() \ No newline at end of file