diff options
author | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-08-14 14:52:24 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-14 20:22:24 +0530 |
commit | 8a37b92bc83db229a788008c5a6a68cf51216ed2 (patch) | |
tree | 1929798a3aa4089203668bd2b93dba497363eb5a /src/environment.js | |
parent | New Crowdin updates (#1786) (diff) | |
download | ferdium-app-8a37b92bc83db229a788008c5a6a68cf51216ed2.tar.gz ferdium-app-8a37b92bc83db229a788008c5a6a68cf51216ed2.tar.zst ferdium-app-8a37b92bc83db229a788008c5a6a68cf51216ed2.zip |
Refactoring: Url helpers (#1789)
These changes are mainly to ensure that 'shell.open*' invocations are only in a single file.
* Moved 'openPath' into the 'url-helpers' file.
* Extract 'openExternalUrl' into a common location in 'url-helpers'
This is done so that we can then apply vetting rules to ensure that there is no security concern as described in https://benjamin-altpeter.de/shell-openexternal-dangers/
Diffstat (limited to 'src/environment.js')
-rw-r--r-- | src/environment.js | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/environment.js b/src/environment.js index 6332ad67b..f2a889be4 100644 --- a/src/environment.js +++ b/src/environment.js | |||
@@ -1,9 +1,7 @@ | |||
1 | import os from 'os'; | 1 | import os from 'os'; |
2 | import { join } from 'path'; | 2 | import { join } from 'path'; |
3 | import { ensureDirSync } from 'fs-extra'; | ||
4 | 3 | ||
5 | import { is, api as electronApi } from 'electron-util'; | 4 | import { is, api as electronApi } from 'electron-util'; |
6 | import { shell } from 'electron'; | ||
7 | 5 | ||
8 | import { DEFAULT_ACCENT_COLOR } from '@meetfranz/theme'; | 6 | import { DEFAULT_ACCENT_COLOR } from '@meetfranz/theme'; |
9 | 7 | ||
@@ -65,11 +63,6 @@ export function asarRecipesPath(...segments) { | |||
65 | return join(asarPath(join(__dirname, 'recipes')), ...([segments].flat())); | 63 | return join(asarPath(join(__dirname, 'recipes')), ...([segments].flat())); |
66 | } | 64 | } |
67 | 65 | ||
68 | export async function openPath(folderName) { | ||
69 | ensureDirSync(folderName); | ||
70 | shell.openPath(folderName); | ||
71 | } | ||
72 | |||
73 | export const useLiveAPI = process.env.USE_LIVE_API; | 66 | export const useLiveAPI = process.env.USE_LIVE_API; |
74 | const useLocalAPI = process.env.USE_LOCAL_API; | 67 | const useLocalAPI = process.env.USE_LOCAL_API; |
75 | 68 | ||