chore: Update process.platform references to use surferPlatform

This commit is contained in:
Mauro Balades 2024-07-10 19:03:28 +02:00
parent 795991d1dc
commit 38b94f1cda
9 changed files with 15 additions and 15 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "@zen-browser/surfer", "name": "@zen-browser/surfer",
"version": "1.0.6", "version": "1.0.7",
"description": "Simplifying building firefox forks!", "description": "Simplifying building firefox forks!",
"main": "index.js", "main": "index.js",
"bin": { "bin": {

View file

@ -163,7 +163,7 @@ export const build = async (options: Options): Promise<void> => {
// Host build // Host build
const prettyHost = platform[process.surferPlatform] const prettyHost = platform[(process as any).surferPlatform]
if (BUILD_TARGETS.includes(prettyHost)) { if (BUILD_TARGETS.includes(prettyHost)) {
if (!options.skipPatchCheck) await patchCheck() if (!options.skipPatchCheck) await patchCheck()

View file

@ -53,7 +53,7 @@ async function unpackFirefoxSource(name: string): Promise<void> {
// //
// If BSD tar adds --transform support in the future, we can use that // If BSD tar adds --transform support in the future, we can use that
// instead // instead
if (process.surferPlatform == 'darwin') { if ((process as any).surferPlatform == 'darwin') {
// GNU Tar doesn't come preinstalled on any MacOS machines, so we need to // GNU Tar doesn't come preinstalled on any MacOS machines, so we need to
// check for it and ask for the user to install it if necessary // check for it and ask for the user to install it if necessary
if (!commandExistsSync('gtar')) { if (!commandExistsSync('gtar')) {
@ -69,7 +69,7 @@ async function unpackFirefoxSource(name: string): Promise<void> {
tarExec, tarExec,
[ [
'--strip-components=1', '--strip-components=1',
process.surferPlatform == 'win32' ? '--force-local' : undefined, (process as any).surferPlatform == 'win32' ? '--force-local' : undefined,
'-xf', '-xf',
windowsPathToUnix(resolve(MELON_TMP_DIR, name)), windowsPathToUnix(resolve(MELON_TMP_DIR, name)),
'-C', '-C',

View file

@ -69,7 +69,7 @@ export const surferPackage = async () => {
// Windows has some special dist files that are available within the dist // Windows has some special dist files that are available within the dist
// directory. // directory.
if (process.surferPlatform == 'win32') { if ((process as any).surferPlatform == 'win32') {
const installerDistributionDirectory = join( const installerDistributionDirectory = join(
OBJ_DIR, OBJ_DIR,
'dist', 'dist',
@ -143,7 +143,7 @@ async function createMarFile(version: string, channel: string) {
join(OBJ_DIR, 'dist/host/bin', 'mar') join(OBJ_DIR, 'dist/host/bin', 'mar')
) )
if (process.surferPlatform == 'win32') { if ((process as any).surferPlatform == 'win32') {
marBinary += '.exe' marBinary += '.exe'
} }
@ -151,7 +151,7 @@ async function createMarFile(version: string, channel: string) {
// <obj dir>/dist/${binaryName}/${brandFullName}.app and on everything else, // <obj dir>/dist/${binaryName}/${brandFullName}.app and on everything else,
// the contents of the folder <obj dir>/dist/${binaryName} // the contents of the folder <obj dir>/dist/${binaryName}
const binary = const binary =
process.surferPlatform == 'darwin' (process as any).surferPlatform == 'darwin'
? join(OBJ_DIR, 'dist', config.binaryName, `${getCurrentBrandName()}.app`) ? join(OBJ_DIR, 'dist', config.binaryName, `${getCurrentBrandName()}.app`)
: join(OBJ_DIR, 'dist', config.binaryName) : join(OBJ_DIR, 'dist', config.binaryName)

View file

@ -109,7 +109,7 @@ async function setupImages(configPath: string, outputPath: string) {
) )
// TODO: Custom MacOS icon support // TODO: Custom MacOS icon support
if (process.surferPlatform == 'darwin') { if ((process as any).surferPlatform == 'darwin') {
log.debug('Generating Mac Icons') log.debug('Generating Mac Icons')
const temporary = join(MELON_TMP_DIR, 'macos_icon_info.iconset') const temporary = join(MELON_TMP_DIR, 'macos_icon_info.iconset')

View file

@ -29,7 +29,7 @@ export const copyManual = async (name: string): Promise<void> => {
} }
if ( if (
process.surferPlatform == 'win32' && (process as any).surferPlatform == 'win32' &&
!config.buildOptions.windowsUseSymbolicLinks !config.buildOptions.windowsUseSymbolicLinks
) { ) {
// Make the directory if it doesn't already exist. // Make the directory if it doesn't already exist.

View file

@ -52,7 +52,7 @@ function getReleaseMarName(releaseInfo: ReleaseInfo): string | undefined {
return return
} }
switch (process.surferPlatform) { switch ((process as any).surferPlatform) {
case 'win32': { case 'win32': {
return releaseInfo.x86?.windowsMar return releaseInfo.x86?.windowsMar
} }
@ -113,11 +113,11 @@ async function writeUpdateFileToDisk(
} }
function getTargets(): string[] { function getTargets(): string[] {
if (process.surferPlatform == 'win32') { if ((process as any).surferPlatform == 'win32') {
return ausPlatformsMap.win64 return ausPlatformsMap.win64
} }
if (process.surferPlatform == 'linux') { if ((process as any).surferPlatform == 'linux') {
return ausPlatformsMap.linux64 return ausPlatformsMap.linux64
} }

View file

@ -59,9 +59,9 @@ export MOZ_APPUPDATE_HOST=${
} }
function getPlatformOptimiseFlags(): string { function getPlatformOptimiseFlags(): string {
let optimiseFlags = `# Unknown platform ${process.surferPlatform}` let optimiseFlags = `# Unknown platform ${(process as any).surferPlatform}`
switch (process.surferPlatform) { switch ((process as any).surferPlatform) {
case 'linux': { case 'linux': {
optimiseFlags = `ac_add_options --enable-optimize="-O3 -march=haswell -mtune=haswell -w"` optimiseFlags = `ac_add_options --enable-optimize="-O3 -march=haswell -mtune=haswell -w"`
break break

View file

@ -89,7 +89,7 @@ for (const command of commands) {
if ( if (
command.flags && command.flags &&
command.flags.platforms && command.flags.platforms &&
!command.flags.platforms.includes(process.surferPlatform) !command.flags.platforms.includes((process as any).surferPlatform)
) { ) {
continue continue
} }