chore: Update package.json version to 1.1.1 and optimize Windows platform flags

This commit is contained in:
Mauro Balades 2024-07-23 16:47:49 +02:00
parent 0be65d2f63
commit 9819e0e84d
3 changed files with 11 additions and 9 deletions

View file

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

View file

@ -21,6 +21,7 @@ import {
unpackAddon, unpackAddon,
} from './addon' } from './addon'
import { configPath } from '../../utils'; import { configPath } from '../../utils';
import fs from 'fs-extra'
export function shouldSetupFirefoxSource() { export function shouldSetupFirefoxSource() {
return !( return !(
@ -67,9 +68,16 @@ async function unpackFirefoxSource(name: string): Promise<void> {
log.info(`Unpacking ${resolve(MELON_TMP_DIR, name)} to ${ENGINE_DIR}`) log.info(`Unpacking ${resolve(MELON_TMP_DIR, name)} to ${ENGINE_DIR}`)
if (process.platform === 'win32') { if (process.platform === 'win32') {
log.info('Unpacking Firefox source on Windows (7z)') log.info('Unpacking Firefox source on Windows (7z)')
await execa('7z', ['x', resolve(MELON_TMP_DIR, name)]); await execa('7z', ['x', resolve(MELON_TMP_DIR, name), '-o' + resolve(MELON_TMP_DIR, name.replace('.tar.xz', '.tar'))]);
log.info('Unpacking Firefox source again without the .xz extension') log.info('Unpacking Firefox source again without the .xz extension')
await execa('7z', ['x', resolve(MELON_TMP_DIR, name.replace('.tar.xz', '.tar')), '-o' + ENGINE_DIR]); await execa('7z', ['x', resolve(MELON_TMP_DIR, name.replace('.tar.xz', '.tar')), '-o' + MELON_TMP_DIR]);
const archiveDir = resolve(MELON_TMP_DIR, 'firefox-' + config.version.version);
if (existsSync(ENGINE_DIR)) {
// remove the existing engine directory
fs.removeSync(ENGINE_DIR);
}
log.info('Moving Firefox source to engine directory');
fs.moveSync(archiveDir, ENGINE_DIR);
return return
} }

View file

@ -43,25 +43,21 @@ export const init = async (directory: Command | string): Promise<void> => {
await configDispatch('git', { await configDispatch('git', {
args: ['init'], args: ['init'],
cwd: absoluteInitDirectory, cwd: absoluteInitDirectory,
shell: 'unix',
}) })
await configDispatch('git', { await configDispatch('git', {
args: ['init'], args: ['init'],
cwd: absoluteInitDirectory, cwd: absoluteInitDirectory,
shell: 'unix',
}) })
await configDispatch('git', { await configDispatch('git', {
args: ['checkout', '--orphan', version], args: ['checkout', '--orphan', version],
cwd: absoluteInitDirectory, cwd: absoluteInitDirectory,
shell: 'unix',
}) })
await configDispatch('git', { await configDispatch('git', {
args: ['add', '-f', '.'], args: ['add', '-f', '.'],
cwd: absoluteInitDirectory, cwd: absoluteInitDirectory,
shell: 'unix',
}) })
log.info('Committing...') log.info('Committing...')
@ -69,12 +65,10 @@ export const init = async (directory: Command | string): Promise<void> => {
await configDispatch('git', { await configDispatch('git', {
args: ['commit', '-aqm', `"Firefox ${version}"`], args: ['commit', '-aqm', `"Firefox ${version}"`],
cwd: absoluteInitDirectory, cwd: absoluteInitDirectory,
shell: 'unix',
}) })
await configDispatch('git', { await configDispatch('git', {
args: ['checkout', '-b', config.name.toLowerCase().replace(/\s/g, '_')], args: ['checkout', '-b', config.name.toLowerCase().replace(/\s/g, '_')],
cwd: absoluteInitDirectory, cwd: absoluteInitDirectory,
shell: 'unix',
}) })
} }