introduce some kind of cherry pick scripts
This commit is contained in:
commit
87ec879def
2 changed files with 176 additions and 0 deletions
15
replaceScript.ts
Normal file
15
replaceScript.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import fs from 'fs'
|
||||
|
||||
let file = fs.readFileSync('./.git/rebase-merge/git-rebase-todo', 'utf8')
|
||||
|
||||
const actions = fs.readFileSync('./actions', 'utf8')
|
||||
|
||||
actions.split('\n').forEach(action => {
|
||||
const [type, commit] = action.split(' ')
|
||||
// if (!file.includes(`pick ${commit}`)) throw new Error(`Commit ${commit} not found`)
|
||||
file = file.replace(`pick ${commit}`, `${type} ${commit}`)
|
||||
})
|
||||
|
||||
fs.writeFileSync('./actions2', file, 'utf8')
|
||||
|
||||
fs.writeFileSync('./.git/rebase-merge/git-rebase-todo', file, 'utf8')
|
||||
Loading…
Add table
Add a link
Reference in a new issue