mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-04 13:23:28 +00:00
* Setup script revamp * Move toml to dev dep + CI runs the postinstall in debug mode * Fix windows CI * chmod +x scripts/setup.sh * Fix eslint and ts CI * Remove binstall + Fix trying to read input in CI * Doesn't need to check pnpm and rust in CI * Run postinstall script for Clippy CI * Attempt to fix windows CI not running postinstall - Ignore cache when running postinstall on CI * commited generated config.toml by mistake * Pass GITHUB_TOKEN to `pnpm i` * Update archive-wasm + Increase minimum node version to 18.17 * CI: Move rust setup after post-install script * Revert: CI: Move rust setup after post-install script * Fix CI, generate dummy cargo config.toml to fix prisma generation * Fix windows CI * CI: Fix wrong command --------- Co-authored-by: Utku <74243531+utkubakir@users.noreply.github.com>
94 lines
1.8 KiB
JavaScript
94 lines
1.8 KiB
JavaScript
// Suffixes
|
|
export const PROTOC_SUFFIX = {
|
|
Linux: {
|
|
i386: 'linux-x86_32',
|
|
i686: 'linux-x86_32',
|
|
x86_64: 'linux-x86_64',
|
|
arm64: 'linux-aarch_64',
|
|
aarch64: 'linux-aarch_64'
|
|
},
|
|
Darwin: {
|
|
x86_64: 'osx-x86_64',
|
|
arm64: 'osx-aarch_64',
|
|
aarch64: 'osx-aarch_64'
|
|
},
|
|
Windows_NT: {
|
|
i386: 'win32',
|
|
i686: 'win32',
|
|
x86_64: 'win64'
|
|
}
|
|
};
|
|
|
|
export const PDFIUM_SUFFIX = {
|
|
Linux: {
|
|
x86_64: {
|
|
musl: 'linux-musl-x64',
|
|
glibc: 'linux-x64'
|
|
},
|
|
arm64: 'linux-arm64',
|
|
aarch64: 'linux-arm64'
|
|
},
|
|
Darwin: {
|
|
x86_64: 'mac-x64',
|
|
arm64: 'mac-arm64',
|
|
aarch64: 'mac-arm64'
|
|
},
|
|
Windows_NT: {
|
|
x86_64: 'win-x64',
|
|
arm64: 'win-arm64',
|
|
aarch64: 'win-arm64'
|
|
}
|
|
};
|
|
|
|
export const FFMPEG_SUFFFIX = {
|
|
Darwin: {
|
|
x86_64: 'x86_64',
|
|
arm64: 'arm64',
|
|
aarch64: 'arm64'
|
|
},
|
|
Windows_NT: {
|
|
x86_64: 'x86_64'
|
|
}
|
|
};
|
|
|
|
export const FFMPEG_WORKFLOW = {
|
|
Darwin: 'ffmpeg-macos.yml',
|
|
Windows_NT: 'ffmpeg-windows.yml'
|
|
};
|
|
|
|
export const TAURI_CLI_SUFFIX = {
|
|
Darwin: {
|
|
x86_64: 'x86_64-apple-darwin',
|
|
arm64: 'aarch64-apple-darwin',
|
|
aarch64: 'aarch64-apple-darwin'
|
|
}
|
|
};
|
|
|
|
/**
|
|
* @param {Record<string, unknown>} constants
|
|
* @param {string[]} identifiers
|
|
* @returns {string?}
|
|
*/
|
|
export function getConst(constants, identifiers) {
|
|
/** @type {string | Record<string, unknown>} */
|
|
let constant = constants;
|
|
|
|
for (const id of identifiers) {
|
|
constant = /** @type {string | Record<string, unknown>} */ (constant[id]);
|
|
if (!constant) return null;
|
|
if (typeof constant !== 'object') break;
|
|
}
|
|
|
|
return typeof constant === 'string' ? constant : null;
|
|
}
|
|
|
|
/**
|
|
* @param {Record<string, unknown>} suffixes
|
|
* @param {string[]} identifiers
|
|
* @returns {RegExp?}
|
|
*/
|
|
export function getSuffix(suffixes, identifiers) {
|
|
const suffix = getConst(suffixes, identifiers);
|
|
return suffix ? new RegExp(`${suffix}(\\.[^\\.]+)*$`) : null;
|
|
}
|