2
0
mirror of https://github.com/kazhala/dotbare synced 2024-11-19 15:25:46 +00:00
dotbare/scripts/fpop
2020-04-06 15:29:30 +10:00

10 lines
424 B
Bash
Executable File

#!/bin/bash
selected_stash=$(/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME stash list | \
fzf --exit-0 --preview "echo {} | sed 's/://g' | awk '{print \$1}' | \
xargs -I __ /usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME stash show -p __ --color" | \
sed 's/://g' | awk '{print $1}')
[[ -z "$selected_stash" ]] && exit 0
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME stash apply "$selected_stash"