introduce some kind of cherry pick scripts

This commit is contained in:
Vitaly 2023-09-19 23:03:15 +03:00
commit 87ec879def
2 changed files with 176 additions and 0 deletions

15
replaceScript.ts Normal file
View 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')