Allow disabling of patch checks

This commit is contained in:
trickypr 2022-04-12 15:49:22 +10:00
parent c69a0300ed
commit 0766066cd7
2 changed files with 10 additions and 16 deletions

View file

@ -16,15 +16,16 @@ export const commands: Cmd[] = [
description:
'Build the melon app. Specify the OS param for cross-platform builds.',
options: [
{
arg: '--a, --arch <architecture>',
description: 'Specify architecture for build',
},
{
arg: '--u, --ui',
description:
'Only builds the ui. Faster but not as powerful as a regular build.',
},
{
arg: '--skip-patch-check',
description:
"Doesn't check to see if all of the patches have been applied",
},
],
requestController: async () => (await import('./commands/build')).build,
},

View file

@ -16,7 +16,7 @@ const platform: Record<string, string> = {
linux: 'linux',
}
const applyConfig = async (os: string, arch: string) => {
const applyConfig = async (os: string) => {
log.info('Applying mozconfig...')
let changeset
@ -55,14 +55,7 @@ const applyConfig = async (os: string, arch: string) => {
)
const osConfig = stringTemplate(
readFileSync(
resolve(
CONFIGS_DIR,
os,
arch === 'i686' ? 'mozconfig-i686' : 'mozconfig'
),
'utf-8'
),
readFileSync(resolve(CONFIGS_DIR, os, 'mozconfig'), 'utf-8'),
templateOptions
)
@ -144,8 +137,8 @@ const success = (date: number) => {
}
interface Options {
arch: string
ui: boolean
skipPatchCheck: boolean
}
export const build = async (options: Options): Promise<void> => {
@ -156,9 +149,9 @@ export const build = async (options: Options): Promise<void> => {
const prettyHost = platform[process.platform]
if (BUILD_TARGETS.includes(prettyHost)) {
await patchCheck()
if (!options.skipPatchCheck) await patchCheck()
await applyConfig(prettyHost, options.arch)
await applyConfig(prettyHost)
log.info('Starting build...')