diff options
author | 2021-08-08 00:01:37 +0000 | |
---|---|---|
committer | 2021-08-08 05:31:37 +0530 | |
commit | 97d51a7763b14c92ee71ff9a012311dd9498d803 (patch) | |
tree | bd36005031ecb1148f27aa541e7a92a5e3aa4c0c /src/scripts | |
parent | 5.6.1-nightly.17 [skip ci] (diff) | |
download | ferdium-app-97d51a7763b14c92ee71ff9a012311dd9498d803.tar.gz ferdium-app-97d51a7763b14c92ee71ff9a012311dd9498d803.tar.zst ferdium-app-97d51a7763b14c92ee71ff9a012311dd9498d803.zip |
refactor: path-references refactoring and using 'import' instead of 'require' (#1752)
* refactor references to 'userData' and 'appData' directories to move hardcoding into single location
* convert to es6 for lower memory usage as per https://codesource.io/the-difference-between-import-and-require-in-javascript/
Diffstat (limited to 'src/scripts')
-rw-r--r-- | src/scripts/add-crowdin-contributors.js | 2 | ||||
-rw-r--r-- | src/scripts/build-theme-info.js | 4 | ||||
-rw-r--r-- | src/scripts/link-readme.js | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/scripts/add-crowdin-contributors.js b/src/scripts/add-crowdin-contributors.js index efe981b6e..ed29a0daf 100644 --- a/src/scripts/add-crowdin-contributors.js +++ b/src/scripts/add-crowdin-contributors.js | |||
@@ -58,7 +58,7 @@ const fs = require('fs-extra'); | |||
58 | const path = require('path'); | 58 | const path = require('path'); |
59 | const allContributors = require('all-contributors-cli'); | 59 | const allContributors = require('all-contributors-cli'); |
60 | 60 | ||
61 | const infoPath = path.join(__dirname, '../../.all-contributorsrc'); | 61 | const infoPath = path.join(__dirname, '..', '..', '.all-contributorsrc'); |
62 | 62 | ||
63 | (async () => { | 63 | (async () => { |
64 | const info = await fs.readJSON(infoPath); | 64 | const info = await fs.readJSON(infoPath); |
diff --git a/src/scripts/build-theme-info.js b/src/scripts/build-theme-info.js index cff33e3c4..4058be942 100644 --- a/src/scripts/build-theme-info.js +++ b/src/scripts/build-theme-info.js | |||
@@ -15,8 +15,8 @@ const accentColors = [ | |||
15 | '#5e50ee', | 15 | '#5e50ee', |
16 | ]; | 16 | ]; |
17 | 17 | ||
18 | const cssFile = path.join(__dirname, '../../', 'build', 'styles', 'main.css'); | 18 | const cssFile = path.join(__dirname, '..', '..', 'build', 'styles', 'main.css'); |
19 | const outputFile = path.join(__dirname, '../', 'assets', 'themeInfo.json'); | 19 | const outputFile = path.join(__dirname, '..', 'assets', 'themeInfo.json'); |
20 | 20 | ||
21 | // Parse and extract the rules from a CSS stylesheet file | 21 | // Parse and extract the rules from a CSS stylesheet file |
22 | async function getRulesFromCssFile(file) { | 22 | async function getRulesFromCssFile(file) { |
diff --git a/src/scripts/link-readme.js b/src/scripts/link-readme.js index 694b89700..1e47cddf8 100644 --- a/src/scripts/link-readme.js +++ b/src/scripts/link-readme.js | |||
@@ -11,7 +11,7 @@ const path = require('path'); | |||
11 | 11 | ||
12 | console.log('Linking issues and PRs in README.md'); | 12 | console.log('Linking issues and PRs in README.md'); |
13 | 13 | ||
14 | const readmepath = path.join(__dirname, '../../', 'README.md'); | 14 | const readmepath = path.join(__dirname, '..', '..', 'README.md'); |
15 | 15 | ||
16 | // Read README.md | 16 | // Read README.md |
17 | let readme = fs.readFileSync(readmepath, 'utf-8'); | 17 | let readme = fs.readFileSync(readmepath, 'utf-8'); |