This commit is contained in:
purocean
2019-08-07 18:56:41 +08:00
parent 1d9de3c58c
commit 6b59b33b58
16 changed files with 55 additions and 35 deletions
+4 -2
View File
@@ -12,10 +12,12 @@ install:
- cd frontend
- yarn
- cd ../app
- ./win_install.bat
- ./win-install.bat
- cd ..
script:
- cd frontend
- yarn run dist
- cd ../app
- ./win_build.bat
- ./win-build.bat
- cd ..
+2 -2
View File
@@ -126,9 +126,9 @@ yarn run serve
REM Electron 端
cd ../app
REM 安装依赖
win_install.bat
win-install.bat
REM 打包 打包前请在前端目录运行打包命令
win_build.bat
win-build.bat
REM 开发
yarn run start
```
+1
View File
@@ -2,3 +2,4 @@ node_modules
dist
vs
out
bin
-2
View File
@@ -1,2 +0,0 @@
*.exe filter=lfs diff=lfs merge=lfs -text
pandoc filter=lfs diff=lfs merge=lfs -text
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e17fc39dac7d3d85f02e170b59572b459cfa1def0f31a846da205ced99e1b1c6
size 60319532
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ad46dc1745dad0d4dbdb4fe14892534eca3a8507d35e33fd7eadc6d7fda05fea
size 74689368
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:67f139c18f0386ffc00512c198f6e92729bcb4ef15fe3e4c0d7c5f6565361c07
size 139522412
+25
View File
@@ -0,0 +1,25 @@
const os = require('os')
const path = require('path')
const fs = require('fs-extra')
const platform = os.platform()
const assetsPath = path.join(__dirname, 'dist/assets')
try {
fs.unlinkSync(assetsPath)
} catch {
}
fs.copySync(path.join(__dirname, 'src/assets'), assetsPath)
if (platform === 'win32') {
const pandocFilePath = path.join(__dirname, 'dist/pandoc.exe')
if (!fs.existsSync(pandocFilePath)) {
fs.copySync(path.join(__dirname, 'bin/win32-pandoc-2.7.3.exe'), pandocFilePath)
}
} else {
const pandocFilePath = path.join(__dirname, 'dist/pandoc')
if (!fs.existsSync(pandocFilePath)) {
fs.copySync(path.join(__dirname, `bin/${platform}-pandoc-2.7.3`), pandocFilePath)
}
}
-18
View File
@@ -1,18 +0,0 @@
const os = require('os')
const path = require('path')
const fs = require('fs-extra')
const platform = os.platform()
try {
fs.unlinkSync(path.join(__dirname, 'dist/assets'))
} catch (error) {
}
fs.copySync(path.join(__dirname, 'src/assets'), path.join(__dirname, 'dist/assets'))
if (platform === 'win32') {
fs.copySync(path.join(__dirname, 'bin/pandoc/2.7.3/win32/pandoc.exe'), path.join(__dirname, 'dist/pandoc.exe'))
} else {
fs.copySync(path.join(__dirname, `bin/pandoc/2.7.3/${platform}/pandoc`), path.join(__dirname, 'dist/pandoc'))
}
+17
View File
@@ -0,0 +1,17 @@
const os = require('os')
const fs = require('fs')
const path = require('path')
const request = require('request')
const filename = os.platform() + '-' + 'pandoc-2.7.3' + (os.platform() === 'win32' ? '.exe' : '')
const downloadUrl = 'https://github.com/purocean/yn/releases/download/v1.1/' + filename
const dir = path.join(__dirname, './bin')
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir)
}
const filePath = path.join(dir, filename)
console.log('Download pandoc', downloadUrl, filename, filePath)
request(downloadUrl).pipe(fs.createWriteStream(filePath))
+2
View File
@@ -11,3 +11,5 @@ export npm_config_runtime=electron
export npm_config_build_from_source=true
# Install all dependencies, and store cache to ~/.electron-gyp.
HOME=~/.electron-gyp yarn
yarn run download-pandoc
+2 -1
View File
@@ -8,7 +8,8 @@
"email": "purocean@outlook.com"
},
"scripts": {
"copy-assets": "node copy_assets.js",
"download-pandoc": "node download-pandoc.js",
"copy-assets": "node copy-assets.js",
"build": "tsc && npm run copy-assets",
"serve": "ts-node src/server/main.ts",
"start": "npm run build && electron ./dist/app.js"
@@ -6,4 +6,5 @@ set npm_config_runtime="electron"
set npm_config_cache=~\.npm-electron
REM npm i --registry=https://registry.npm.taobao.org
yarn
yarn run download-pandoc
endlocal
+1 -1
View File
@@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"copy-assets": "node copy_assets.js",
"copy-assets": "node copy-assets.js",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",