mirror of
https://github.com/zen-browser/surfer.git
synced 2025-07-08 01:10:03 +02:00
🐛 Only use bash shell for git init
This commit is contained in:
parent
5bf2b5ac87
commit
d0e6248fd2
2 changed files with 104 additions and 37 deletions
|
@ -7,7 +7,7 @@ import Listr from 'listr'
|
|||
import { resolve } from 'path'
|
||||
import { bin_name } from '..'
|
||||
import { log } from '../log'
|
||||
import { config, dispatch } from '../utils'
|
||||
import { config, configDispatch, dispatch } from '../utils'
|
||||
|
||||
export const init = async (
|
||||
directory: Command | string,
|
||||
|
@ -51,28 +51,48 @@ export const init = async (
|
|||
|
||||
// TODO: Use bash on windows, this may significantly improve performance. Still needs testing though
|
||||
logInfo('Initializing git, this may take some time')
|
||||
await dispatch('git', ['init'], dir as string, false, logInfo)
|
||||
await dispatch(
|
||||
'git',
|
||||
['checkout', '--orphan', version],
|
||||
dir as string,
|
||||
false,
|
||||
logInfo
|
||||
)
|
||||
await dispatch('git', ['add', '-f', '.'], dir as string, false, logInfo)
|
||||
|
||||
await configDispatch('git', {
|
||||
args: ['init'],
|
||||
cwd: dir,
|
||||
logger: logInfo,
|
||||
shell: 'unix',
|
||||
})
|
||||
|
||||
await configDispatch('git', {
|
||||
args: ['init'],
|
||||
cwd: dir,
|
||||
logger: logInfo,
|
||||
shell: 'unix',
|
||||
})
|
||||
|
||||
await configDispatch('git', {
|
||||
args: ['checkout', '--orphan', version],
|
||||
cwd: dir,
|
||||
logger: logInfo,
|
||||
shell: 'unix',
|
||||
})
|
||||
|
||||
await configDispatch('git', {
|
||||
args: ['add', '-f', '.'],
|
||||
cwd: dir,
|
||||
logger: logInfo,
|
||||
shell: 'unix',
|
||||
})
|
||||
|
||||
logInfo('Committing...')
|
||||
await dispatch(
|
||||
'git',
|
||||
['commit', '-aqm', `"Firefox ${version}"`],
|
||||
dir as string,
|
||||
false,
|
||||
logInfo
|
||||
)
|
||||
await dispatch(
|
||||
'git',
|
||||
['checkout', '-b', config.name.toLowerCase().replace(/\s/g, '_')],
|
||||
dir as string,
|
||||
false,
|
||||
logInfo
|
||||
)
|
||||
|
||||
await configDispatch('git', {
|
||||
args: ['commit', '-aqm', `"Firefox ${version}"`],
|
||||
cwd: dir,
|
||||
logger: logInfo,
|
||||
shell: 'unix',
|
||||
})
|
||||
|
||||
await configDispatch('git', {
|
||||
args: ['checkout', '-b', config.name.toLowerCase().replace(/\s/g, '_')],
|
||||
cwd: dir,
|
||||
logger: logInfo,
|
||||
shell: 'unix',
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue