2
0
mirror of https://github.com/kazhala/dotbare synced 2024-11-06 09:20:25 +00:00
dotbare/tests/fzf

20 lines
723 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
#
# This script is for mocking fzf for testing,
# it will stop fzf for goin into a interactive mode
#
# usage:
# export PATH="${BATS_TEST_DIRNAME}:$PATH"
if [[ "$*" =~ "--header=Select a commit to checkout" ]] && [[ "$*" =~ "show --color" ]]; then
echo "--commitshow"
elif [[ "$*" =~ "--no-multi --header=Select a branch to checkout" ]]; then
echo "--branch"
elif [[ "$*" =~ "--header=select a file to checkout version in HEAD --preview" ]]; then
echo "-- modifiedfile"
elif [[ "$*" =~ '--header=select a file to checkout' ]] && [[ "$*" =~ "cat" ]]; then
echo "selectgitfile"
elif [[ "$*" =~ '--header=select the target commit' ]] && [[ "$*" =~ "diff --color" ]]; then
echo "commitdiff"
fi