MCPcopy Index your code
hub / github.com/gitify-app/gitify / checkAndMarkFirstRun

Function checkAndMarkFirstRun

src/main/lifecycle/first-run.ts:59–82  ·  view source on GitHub ↗

* Determine if this is the first run of the application by checking for the existence of a specific file. * * @returns true if this is the first run, false otherwise

()

Source from the content-addressed store, hash-verified

57 * @returns true if this is the first run, false otherwise
58 */
59function checkAndMarkFirstRun(): boolean {
60 const configPath = getConfigPath();
61
62 try {
63 if (fs.existsSync(configPath)) {
64 return false;
65 }
66
67 const firstRunFolder = path.dirname(configPath);
68 if (!fs.existsSync(firstRunFolder)) {
69 fs.mkdirSync(firstRunFolder);
70 }
71
72 fs.writeFileSync(configPath, '');
73 } catch (err) {
74 logError(
75 'checkAndMarkFirstRun',
76 'Unable to write firstRun file',
77 toError(err),
78 );
79 }
80
81 return true;
82}

Callers 1

onFirstRunMaybeFunction · 0.85

Calls 3

logErrorFunction · 0.90
toErrorFunction · 0.90
getConfigPathFunction · 0.85

Tested by

no test coverage detected