forked from YeonV/LedFx-Frontend-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
90 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as path from 'path' | ||
import * as fs from 'fs' | ||
import { app } from 'electron' | ||
|
||
export function createLedfxFolder() { | ||
const userDataPath = app.getPath('userData') | ||
const ledfxFolderPath = path.join(userDataPath, '.ledfx-cc') | ||
if (!fs.existsSync(ledfxFolderPath)) { | ||
console.log('Creating .ledfx-cc folder') | ||
fs.mkdirSync(ledfxFolderPath) | ||
} | ||
} | ||
|
||
export default createLedfxFolder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import * as path from 'path' | ||
import * as fs from 'fs' | ||
import { app } from 'electron' | ||
|
||
export function getReduxPath(): string | false { | ||
const appDataPath = app.getPath('appData') | ||
const localAppDataPath = path.join(appDataPath, '..', 'Local') | ||
const chromeExtensionsPath = path.join( | ||
localAppDataPath, | ||
'Google', | ||
'Chrome', | ||
'User Data', | ||
'Default', | ||
'Extensions' | ||
) | ||
const reduxDevtoolsId = 'lmhkpmbekcpmknklioeibfkpmmfibljd' | ||
|
||
if (fs.existsSync(chromeExtensionsPath)) { | ||
const reduxDevtoolsDir = path.join(chromeExtensionsPath, reduxDevtoolsId) | ||
if (fs.existsSync(reduxDevtoolsDir)) { | ||
const versions = fs.readdirSync(reduxDevtoolsDir) | ||
if (versions.length > 0) { | ||
const latestVersion = versions.sort().pop() // Get the latest version | ||
if (latestVersion !== undefined) { | ||
const reduxDevtoolsPath = path.join(reduxDevtoolsDir, latestVersion) | ||
if (fs.existsSync(reduxDevtoolsPath)) { | ||
return reduxDevtoolsPath | ||
} | ||
} | ||
} | ||
} | ||
} else { | ||
console.info('Chrome extensions path does not exist:', chromeExtensionsPath) | ||
} | ||
|
||
return false | ||
} | ||
|
||
export default getReduxPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters