forked from 0xVida/stellar-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforce_rebase.js
More file actions
18 lines (18 loc) · 735 Bytes
/
force_rebase.js
File metadata and controls
18 lines (18 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const cp = require('child_process');
const fs = require('fs');
try {
console.log('Staging all...');
cp.execSync('git add -A');
console.log('Committing...');
try {
cp.execSync('git commit -m "resolve conflicts"');
} catch (e) {
console.log('Commit failed, maybe already committed. ' + e.message);
}
console.log('Rebasing continue...');
const out = cp.execSync('git rebase --continue').toString();
fs.writeFileSync('c:/Users/user/OneDrive/Documents/stellar-suite/rebase_success.txt', out);
} catch (e) {
const errText = e.stdout ? e.stdout.toString() : e.message;
fs.writeFileSync('c:/Users/user/OneDrive/Documents/stellar-suite/rebase_error.txt', errText + '\n' + (e.stderr ? e.stderr.toString() : ''));
}