• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gitify-app / gitify / 12857889163

19 Jan 2025 10:53PM UTC coverage: 87.169% (-0.2%) from 87.327%
12857889163

Pull #1737

github

web-flow
Merge db015b4b1 into 477658fe8
Pull Request #1737: feat: linux check for updates

595 of 665 branches covered (89.47%)

Branch coverage included in aggregate %.

4 of 7 new or added lines in 2 files covered. (57.14%)

1613 of 1868 relevant lines covered (86.35%)

24.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

30.0
/src/main/utils.ts
1
import fs from 'node:fs';
2✔
2
import os from 'node:os';
2✔
3
import path from 'node:path';
2✔
4
import { dialog, shell } from 'electron';
2✔
5
import log from 'electron-log';
2✔
6
import type { Menubar } from 'menubar';
7

8
import { logError, logInfo } from '../shared/logger';
2✔
9

10
export function takeScreenshot(mb: Menubar) {
2✔
11
  const date = new Date();
×
12
  const dateStr = date.toISOString().replace(/:/g, '-');
×
13

14
  const capturedPicFilePath = `${os.homedir()}/${dateStr}-gitify-screenshot.png`;
×
15
  mb.window.capturePage().then((img) => {
×
16
    fs.writeFile(capturedPicFilePath, img.toPNG(), () =>
×
17
      logInfo('takeScreenshot', `Screenshot saved ${capturedPicFilePath}`),
×
18
    );
19
  });
20
}
21

22
export function resetApp(mb: Menubar) {
2✔
23
  const cancelButtonId = 0;
×
24
  const resetButtonId = 1;
×
25

26
  const response = dialog.showMessageBoxSync(mb.window, {
×
27
    type: 'warning',
28
    title: 'Reset Gitify',
29
    message:
30
      'Are you sure you want to reset Gitify? You will be logged out of all accounts',
31
    buttons: ['Cancel', 'Reset'],
32
    defaultId: cancelButtonId,
33
    cancelId: cancelButtonId,
34
  });
35

36
  if (response === resetButtonId) {
×
37
    mb.window.webContents.send('gitify:reset-app');
×
38
    mb.app.quit();
×
39
  }
40
}
41

42
export function openLogsDirectory() {
2✔
43
  const logDirectory = path.dirname(log.transports.file?.getFile()?.path);
×
44

45
  if (!logDirectory) {
×
46
    logError(
×
47
      'openLogsDirectory',
48
      'Could not find log directory!',
49
      new Error('Directory not found'),
50
    );
51
    return;
×
52
  }
53

54
  shell.openPath(logDirectory);
×
55
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc