Created
August 16, 2018 15:58
-
-
Save IanVaughan/c58e5ab8d8fe5b16986215245ec05835 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Usage : | |
# In slack `/todo list` | |
# Copy output, pipe into this script | |
file = ARGV[0] | |
data = File.read(file) | |
# sed -e 's/.*`\(.*\)`.*/git merge --no-edit --no-ff origin\/\1/' | |
FIND = /.*`(.*)`.*/ | |
REPLACE = 'git merge --no-edit --no-ff origin/\1'.freeze | |
cmds = [] | |
cmds << 'git reset origin/master --hard' | |
cmds << data.split("\n").map { |l| l.sub FIND, REPLACE } | |
puts cmds | |
# WIP | |
# cmds.each do |cmd| | |
# puts cmd | |
# system(cmd) | |
# end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment