Skip to content

Commit

Permalink
Bump deps and version, and fix path issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pendo324 committed Apr 25, 2020
1 parent 724c76f commit 70dd482
Show file tree
Hide file tree
Showing 6 changed files with 544 additions and 814 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "universal-np",
"version": "0.2.1",
"version": "0.3.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down Expand Up @@ -45,7 +45,7 @@
"prettier": "^1.18.2",
"sass": "^1.18.0",
"sass-loader": "^7.1.0",
"vue-cli-plugin-electron-builder": "^1.4.0",
"vue-cli-plugin-electron-builder": "^2.0.0",
"vue-cli-plugin-vuetify": "^1.0.0",
"vue-template-compiler": "^2.6.10",
"vuetify-loader": "^1.2.2"
Expand Down
4 changes: 4 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ export default {
</script>

<style lang="scss">
html {
overflow-y: auto !important;
}
.footer {
padding-left: 10px;
// a:not(:first-child) {
Expand Down
13 changes: 9 additions & 4 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import {
createProtocol,
installVueDevtools
} from 'vue-cli-plugin-electron-builder/lib';

const path = require('path');

const isDevelopment = process.env.NODE_ENV !== 'production';

// Keep a global reference of the window object, if you don't, the window will
Expand Down Expand Up @@ -32,7 +35,9 @@ function createWindow() {
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
// Use pluginOptions.nodeIntegration, leave this alone
// See https://github.com/nklayman/vue-cli-plugin-electron-builder/blob/v2/docs/guide/configuration.md#node-integration for more info
nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION
},
darkTheme: true
});
Expand Down Expand Up @@ -93,13 +98,13 @@ app.on('ready', async () => {
// If you are not using Windows 10 dark mode, you may uncomment these lines
// In addition, if the linked issue is closed, you can upgrade electron and uncomment these lines
try {
await installVueDevtools()
await installVueDevtools();
} catch (e) {
console.error('Vue Devtools failed to install:', e.toString())
console.error('Vue Devtools failed to install:', e.toString());
}
}

tray = new Tray('./public/icon.png');
tray = new Tray(path.join(__static, 'icon.png'));
tray.setToolTip('Universal Now Playing');

const mainWindow = createWindow();
Expand Down
30 changes: 14 additions & 16 deletions src/players/iTunes/iTunesHandler_win32.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Handler from './../Handler';
import { remote } from 'electron';
const { exec } = remote.require('child_process');
const { join } = remote.require('path');
const { exec } = require('child_process');
const { join } = require('path');

import { copyWindowsScripts } from '@/util';
import { getProcessByName } from '@pendo324/get-process-by-name';
Expand All @@ -12,21 +12,19 @@ import { getProcessByName } from '@pendo324/get-process-by-name';

const getCurrentTrack = () => {
return new Promise((resolve, reject) => {
exec(
`powershell ${join(
remote.app.getPath('userData'),
'windows_runtime_scripts',
'getTrack_iTunes.ps1'
)}`,
(err, stdout) => {
if (err) {
return reject(err);
}

const parsed = stdout.trim();
resolve(parsed);
const scriptPath = `powershell ${join(
remote.app.getPath('userData'),
'windows_runtime_scripts',
'getTrack_iTunes.ps1'
)}`;
exec(scriptPath, (err, stdout) => {
if (err) {
return reject(err);
}
);

const parsed = stdout.trim();
resolve(parsed);
});
});
};

Expand Down
3 changes: 2 additions & 1 deletion vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ module.exports = {
pluginOptions: {
electronBuilder: {
externals: ['body-parser'],
nodeIntegration: true,
builderOptions: {
win: {
requestedExecutionLevel: 'highestAvailable'
publisherName: 'Flying Lawnmower Development'
}
}
}
Expand Down
Loading

0 comments on commit 70dd482

Please sign in to comment.