diff options
| author | Priyansh <[email protected]> | 2020-12-22 17:50:12 +0530 |
|---|---|---|
| committer | Priyansh <[email protected]> | 2020-12-22 17:50:12 +0530 |
| commit | 22dc033f4938d6a19e086a1cbd36ec5cade5eaab (patch) | |
| tree | 9feb963ccd5c1581e676e41004801abc67db3357 /node_modules/@electron/get/dist/esm/utils.js | |
| parent | e93da8b04da86773247aadb1cbb1912e4f4526b2 (diff) | |
| download | styx-22dc033f4938d6a19e086a1cbd36ec5cade5eaab.tar.xz styx-22dc033f4938d6a19e086a1cbd36ec5cade5eaab.zip | |
Remove node_modules
Diffstat (limited to 'node_modules/@electron/get/dist/esm/utils.js')
| -rw-r--r-- | node_modules/@electron/get/dist/esm/utils.js | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/node_modules/@electron/get/dist/esm/utils.js b/node_modules/@electron/get/dist/esm/utils.js deleted file mode 100644 index 2ffe007..0000000 --- a/node_modules/@electron/get/dist/esm/utils.js +++ /dev/null @@ -1,72 +0,0 @@ -import * as childProcess from 'child_process'; -import * as fs from 'fs-extra'; -import * as os from 'os'; -import * as path from 'path'; -async function useAndRemoveDirectory(directory, fn) { - let result; - try { - result = await fn(directory); - } - finally { - await fs.remove(directory); - } - return result; -} -export async function withTempDirectoryIn(parentDirectory = os.tmpdir(), fn) { - const tempDirectoryPrefix = 'electron-download-'; - const tempDirectory = await fs.mkdtemp(path.resolve(parentDirectory, tempDirectoryPrefix)); - return useAndRemoveDirectory(tempDirectory, fn); -} -export async function withTempDirectory(fn) { - return withTempDirectoryIn(undefined, fn); -} -export function normalizeVersion(version) { - if (!version.startsWith('v')) { - return `v${version}`; - } - return version; -} -/** - * Runs the `uname` command and returns the trimmed output. - */ -export function uname() { - return childProcess - .execSync('uname -m') - .toString() - .trim(); -} -/** - * Generates an architecture name that would be used in an Electron or Node.js - * download file name, from the `process` module information. - */ -export function getHostArch() { - return getNodeArch(process.arch); -} -/** - * Generates an architecture name that would be used in an Electron or Node.js - * download file name. - */ -export function getNodeArch(arch) { - if (arch === 'arm') { - switch (process.config.variables.arm_version) { - case '6': - return uname(); - case '7': - default: - return 'armv7l'; - } - } - return arch; -} -export function ensureIsTruthyString(obj, key) { - if (!obj[key] || typeof obj[key] !== 'string') { - throw new Error(`Expected property "${key}" to be provided as a string but it was not`); - } -} -export function isOfficialLinuxIA32Download(platform, arch, version, mirrorOptions) { - return (platform === 'linux' && - arch === 'ia32' && - Number(version.slice(1).split('.')[0]) >= 4 && - typeof mirrorOptions === 'undefined'); -} -//# sourceMappingURL=utils.js.map
\ No newline at end of file |
