Skip to content

Commit

Permalink
chore: Update package.json version to 1.1.1 and optimize Windows plat…
Browse files Browse the repository at this point in the history
…form flags
  • Loading branch information
mauro-balades committed Jul 23, 2024
1 parent 0be65d2 commit 9819e0e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zen-browser/surfer",
"version": "1.0.39",
"version": "1.1.1",
"description": "Simplifying building firefox forks!",
"main": "index.js",
"bin": {
Expand Down
12 changes: 10 additions & 2 deletions src/commands/download/firefox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
unpackAddon,
} from './addon'
import { configPath } from '../../utils';
import fs from 'fs-extra'

export function shouldSetupFirefoxSource() {
return !(
Expand Down Expand Up @@ -67,9 +68,16 @@ async function unpackFirefoxSource(name: string): Promise<void> {
log.info(`Unpacking ${resolve(MELON_TMP_DIR, name)} to ${ENGINE_DIR}`)
if (process.platform === 'win32') {
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')
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
}

Expand Down
6 changes: 0 additions & 6 deletions src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,38 +43,32 @@ export const init = async (directory: Command | string): Promise<void> => {
await configDispatch('git', {
args: ['init'],
cwd: absoluteInitDirectory,
shell: 'unix',
})

await configDispatch('git', {
args: ['init'],
cwd: absoluteInitDirectory,
shell: 'unix',
})

await configDispatch('git', {
args: ['checkout', '--orphan', version],
cwd: absoluteInitDirectory,
shell: 'unix',
})

await configDispatch('git', {
args: ['add', '-f', '.'],
cwd: absoluteInitDirectory,
shell: 'unix',
})

log.info('Committing...')

await configDispatch('git', {
args: ['commit', '-aqm', `"Firefox ${version}"`],
cwd: absoluteInitDirectory,
shell: 'unix',
})

await configDispatch('git', {
args: ['checkout', '-b', config.name.toLowerCase().replace(/\s/g, '_')],
cwd: absoluteInitDirectory,
shell: 'unix',
})
}

0 comments on commit 9819e0e

Please sign in to comment.