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

gitify-app / gitify / 13031932468

29 Jan 2025 01:03PM UTC coverage: 87.981% (+0.09%) from 87.888%
13031932468

Pull #1781

github

web-flow
Merge 2d8847eff into 73b203001
Pull Request #1781: feat(auth): use system browser for GitHub SSO / OAuth authentication

651 of 725 branches covered (89.79%)

Branch coverage included in aggregate %.

32 of 39 new or added lines in 4 files covered. (82.05%)

26 existing lines in 1 file now uncovered.

1728 of 1979 relevant lines covered (87.32%)

23.64 hits per line

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

0.0
/src/main/first-run.ts
1
import fs from 'node:fs';
×
2
import path from 'node:path';
×
3
import { app, dialog } from 'electron';
×
4

5
import { APPLICATION } from '../shared/constants';
×
6
import { logError } from '../shared/logger';
×
7
import { isMacOS } from '../shared/platform';
×
8

9
export async function onFirstRunMaybe() {
×
10
  if (isFirstRun()) {
×
11
    await promptMoveToApplicationsFolder();
×
12
  }
13
}
14

15
// Ask user if the app should be moved to the applications folder.
16
async function promptMoveToApplicationsFolder() {
17
  if (!isMacOS()) return;
×
18

19
  const isDevMode = !!process.defaultApp;
×
20
  if (isDevMode || app.isInApplicationsFolder()) return;
×
21

22
  const { response } = await dialog.showMessageBox({
×
23
    type: 'question',
24
    buttons: ['Move to Applications Folder', 'Do Not Move'],
25
    defaultId: 0,
26
    message: 'Move to Applications Folder?',
27
  });
28

29
  if (response === 0) {
×
30
    app.moveToApplicationsFolder();
×
31
  }
32
}
33

34
const getConfigPath = () => {
×
35
  const userDataPath = app.getPath('userData');
×
36
  return path.join(userDataPath, 'FirstRun', APPLICATION.FIRST_RUN_FOLDER);
×
37
};
38

39
// Whether or not the app is being run for the first time.
40
function isFirstRun() {
41
  const configPath = getConfigPath();
×
42

43
  try {
×
44
    if (fs.existsSync(configPath)) {
×
45
      return false;
×
46
    }
47

48
    const firstRunFolder = path.dirname(configPath);
×
49
    if (!fs.existsSync(firstRunFolder)) {
×
50
      fs.mkdirSync(firstRunFolder);
×
51
    }
52

53
    fs.writeFileSync(configPath, '');
×
54
  } catch (err) {
55
    logError('isFirstRun', 'Unable to write firstRun file', err);
×
56
  }
57

58
  return true;
×
59
}
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

© 2026 Coveralls, Inc