diff --git a/appveyor.yml b/appveyor.yml index c84196d..712a2ef 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -53,7 +53,7 @@ test_script: - npm --version - npm run lint - npm run dist:win - # - npm run test + - npm run test deploy_script: - IF [%APPVEYOR_REPO_BRANCH%]==[master] npm run publish:win && npm run publish:portable \ No newline at end of file diff --git a/package.json b/package.json index ff676dc..7045a5d 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,8 @@ "license": "MIT", "scripts": { "dev": "cross-env NODE_ENV=development vue-cli-service electron:serve", - "start": "cross-env NODE_ENV=production npm run build:after && electron dist/bundled/background.js", + "start": "cross-env NODE_ENV=production electron dist/bundled/background.js", "build": "vue-cli-service electron:build", - "build:after": "node scripts/afterBuild.js", "build:bindings": "cmake-js build -d bindings -O bindings/build", "move:libs": "node scripts/moveLibs.js", "collect:dylibs": "./collect-dylib-deps.sh", @@ -32,7 +31,7 @@ "install:deps": "bash bindings/scripts/install.sh", "postinstall": "npm run compile:bindings && node scripts/postinstall && electron-builder install-app-deps", "postuninstall": "electron-builder install-app-deps", - "test": "cross-env IS_TEST=true npm run build:after && mocha --reporter mochawesome" + "test": "cross-env IS_TEST=true mocha --reporter mochawesome" }, "dependencies": { "buttercup": "^2.16.1", diff --git a/scripts/afterBuild.js b/scripts/afterBuild.js deleted file mode 100644 index b3ed0cb..0000000 --- a/scripts/afterBuild.js +++ /dev/null @@ -1,53 +0,0 @@ -const { resolve, extname } = require('path') -const { copyFileSync, readdirSync, mkdirSync, existsSync } = require('fs') - -const NATIVE_ADDON_RELEASE_PATH = resolve(__dirname, '..', 'bindings', 'build', 'Release') -const BUNDLE_PATH = resolve(__dirname, '..', 'dist', 'bundled') - -const MPV_PUBLIC_PATH = resolve(__dirname, '..', 'public', 'mpv') -const MPV_PATH = resolve(__dirname, '..', 'dist', 'mpv') - -const actions = { - win32: windows -} - -function moveNativeAddonFiles () { - const nativeFiles = readdirSync(NATIVE_ADDON_RELEASE_PATH) - - nativeFiles.forEach((filename) => { - if (['.dll', '.lib'].includes(extname(filename))) { - console.log(`Moving ${filename} to ${BUNDLE_PATH}`) - - copyFileSync( - resolve(NATIVE_ADDON_RELEASE_PATH, filename), - resolve(BUNDLE_PATH, filename) - ) - } - }) -} - -function moveMPVFiles () { - const mpvFiles = readdirSync(MPV_PUBLIC_PATH) - - if (!existsSync(MPV_PATH)) mkdirSync(MPV_PATH) - - mpvFiles.forEach((filename) => { - if (['.dll', '.node'].includes(extname(filename))) { - console.log(`Moving ${filename} to ${MPV_PATH}`) - - copyFileSync( - resolve(MPV_PUBLIC_PATH, filename), - resolve(MPV_PATH, filename) - ) - } - }) -} - -function windows () { - moveNativeAddonFiles() - moveMPVFiles() -} - -( - actions[process.platform] || (() => {}) -)()