mirror of
https://github.com/zen-browser/surfer.git
synced 2025-07-08 01:10:03 +02:00
🐛 Fix branding crash
This commit is contained in:
parent
3f1d1ea255
commit
3ab25b85cd
2 changed files with 18 additions and 14 deletions
|
@ -9,7 +9,12 @@ import { BUILD_TARGETS, CONFIGS_DIR, ENGINE_DIR } from '../constants'
|
||||||
import { internalMozconfg } from '../constants/mozconfig'
|
import { internalMozconfg } from '../constants/mozconfig'
|
||||||
import { log } from '../log'
|
import { log } from '../log'
|
||||||
import { patchCheck } from '../middleware/patch-check'
|
import { patchCheck } from '../middleware/patch-check'
|
||||||
import { configDispatch, dynamicConfig, stringTemplate } from '../utils'
|
import {
|
||||||
|
BrandInfo,
|
||||||
|
configDispatch,
|
||||||
|
dynamicConfig,
|
||||||
|
stringTemplate,
|
||||||
|
} from '../utils'
|
||||||
|
|
||||||
const platform: Record<string, string> = {
|
const platform: Record<string, string> = {
|
||||||
win32: 'windows',
|
win32: 'windows',
|
||||||
|
@ -30,7 +35,7 @@ const applyConfig = async (os: string) => {
|
||||||
changeset = stdout.trim()
|
changeset = stdout.trim()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log.warning(
|
log.warning(
|
||||||
'Melon expects that you are building your browser with git as your version control'
|
'Gluon expects that you are building your browser with git as your version control'
|
||||||
)
|
)
|
||||||
log.warning(
|
log.warning(
|
||||||
'If you are using some other version control system, please migrate to git'
|
'If you are using some other version control system, please migrate to git'
|
||||||
|
@ -96,8 +101,8 @@ const applyConfig = async (os: string) => {
|
||||||
|
|
||||||
// We need to install the browser display version inside of browser/config/version.txt
|
// We need to install the browser display version inside of browser/config/version.txt
|
||||||
// and browser/config/version_display.txt
|
// and browser/config/version_display.txt
|
||||||
const brandingConfig = config.brands[brandingKey]
|
const brandingConfig: BrandInfo | undefined = config.brands[brandingKey]
|
||||||
const version = brandingConfig.release.displayVersion || '1.0.0'
|
const version = brandingConfig?.release?.displayVersion || '1.0.0'
|
||||||
|
|
||||||
log.debug(`Writing ${version} to the browser version files`)
|
log.debug(`Writing ${version} to the browser version files`)
|
||||||
writeFileSync(join(ENGINE_DIR, 'browser/config/version.txt'), version)
|
writeFileSync(join(ENGINE_DIR, 'browser/config/version.txt'), version)
|
||||||
|
|
|
@ -69,6 +69,14 @@ export interface ReleaseInfo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface BrandInfo {
|
||||||
|
backgroundColor: string
|
||||||
|
brandShorterName: string
|
||||||
|
brandShortName: string
|
||||||
|
brandFullName: string
|
||||||
|
release: ReleaseInfo
|
||||||
|
}
|
||||||
|
|
||||||
export interface GithubAddonInfo {
|
export interface GithubAddonInfo {
|
||||||
platform: 'github'
|
platform: 'github'
|
||||||
id: string
|
id: string
|
||||||
|
@ -136,16 +144,7 @@ export interface Config {
|
||||||
windowsUseSymbolicLinks: boolean
|
windowsUseSymbolicLinks: boolean
|
||||||
}
|
}
|
||||||
addons: Record<string, AddonInfo>
|
addons: Record<string, AddonInfo>
|
||||||
brands: Record<
|
brands: Record<string, BrandInfo>
|
||||||
string,
|
|
||||||
{
|
|
||||||
backgroundColor: string
|
|
||||||
brandShorterName: string
|
|
||||||
brandShortName: string
|
|
||||||
brandFullName: string
|
|
||||||
release: ReleaseInfo
|
|
||||||
}
|
|
||||||
>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const defaultBrandsConfig = {
|
export const defaultBrandsConfig = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue