mirror of
https://github.com/zen-browser/surfer.git
synced 2025-07-07 08:55:33 +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 { log } from '../log'
|
||||
import { patchCheck } from '../middleware/patch-check'
|
||||
import { configDispatch, dynamicConfig, stringTemplate } from '../utils'
|
||||
import {
|
||||
BrandInfo,
|
||||
configDispatch,
|
||||
dynamicConfig,
|
||||
stringTemplate,
|
||||
} from '../utils'
|
||||
|
||||
const platform: Record<string, string> = {
|
||||
win32: 'windows',
|
||||
|
@ -30,7 +35,7 @@ const applyConfig = async (os: string) => {
|
|||
changeset = stdout.trim()
|
||||
} catch (e) {
|
||||
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(
|
||||
'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
|
||||
// and browser/config/version_display.txt
|
||||
const brandingConfig = config.brands[brandingKey]
|
||||
const version = brandingConfig.release.displayVersion || '1.0.0'
|
||||
const brandingConfig: BrandInfo | undefined = config.brands[brandingKey]
|
||||
const version = brandingConfig?.release?.displayVersion || '1.0.0'
|
||||
|
||||
log.debug(`Writing ${version} to the browser version files`)
|
||||
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 {
|
||||
platform: 'github'
|
||||
id: string
|
||||
|
@ -136,16 +144,7 @@ export interface Config {
|
|||
windowsUseSymbolicLinks: boolean
|
||||
}
|
||||
addons: Record<string, AddonInfo>
|
||||
brands: Record<
|
||||
string,
|
||||
{
|
||||
backgroundColor: string
|
||||
brandShorterName: string
|
||||
brandShortName: string
|
||||
brandFullName: string
|
||||
release: ReleaseInfo
|
||||
}
|
||||
>
|
||||
brands: Record<string, BrandInfo>
|
||||
}
|
||||
|
||||
export const defaultBrandsConfig = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue