Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
yoavain committed Nov 9, 2019
1 parent 46b5e52 commit 8ad9a28
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"license": "ISC",
"dependencies": {
"fs-extra": "^8.1.0",
"node-notifier": "file://../node-notifier/node-notifier-7.0.0.tgz",
"node-notifier": "file://../node-notifier/node-notifier-7.0.0.tgz",
"numeral": "^2.0.6",
"request": "^2.88.0",
"winston": "^3.2.1"
Expand All @@ -33,7 +33,6 @@
"@types/fs-extra": "^8.0.1",
"@types/jest": "^24.0.22",
"@types/node": "^12.12.6",
"@types/node-notifier": "^5.4.0",
"@types/numeral": "0.0.26",
"@types/request": "^2.48.3",
"@typescript-eslint/eslint-plugin": "^2.6.1",
Expand Down
20 changes: 9 additions & 11 deletions src/szNotifier.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { NodeNotifier, WindowsToaster } from 'node-notifier';
import notifier, { NodeNotifier } from 'node-notifier';
import * as path from 'path';
import { execFile } from "child_process";
import notifier from "node-notifier";
import * as path from "path";
import { execFile } from 'child_process';
import { ISzLogger } from './szLogger';

const WindowsToaster = notifier.WindowsToaster;
Expand Down Expand Up @@ -40,21 +38,21 @@ export class SzNotifier implements ISzNotifier {
}

public notif = (message: string, notificationIcon: NotificationIcon, openLog?: boolean) => {
this.logger.verbose(`Looking for icon in: ${path.join("notif-icons", notificationIcon)}`);
this.logger.verbose(`Looking for icon in: ${path.join('notif-icons', notificationIcon)}`);
if (this.notifier) {
const notification: Notification = {
title: 'Screwzira Subtitle Downloader',
message,
icon: path.join("notif-icons", notificationIcon)
icon: path.join('notif-icons', notificationIcon)
};
if (openLog) {
notification.actions = ["Log"]
notification.actions = ['Log'];
}
this.notifier.notify(notification);
this.notifier.on("log", () => {
const file = path.join(process.env.ProgramData, "Screwzira-Downloader", "screwzira-downloader.log");
execFile(file, { shell: "cmd" });
})
this.notifier.on('log', () => {
const file = path.join(process.env.ProgramData, 'Screwzira-Downloader', 'screwzira-downloader.log');
execFile(file, { shell: 'cmd' });
});
}
else {
this.logger.info(`Quiet Mode. Skipping notification message: ${message}`);
Expand Down

0 comments on commit 8ad9a28

Please sign in to comment.