Skip to content

Commit

Permalink
feat: add examples to empty history file
Browse files Browse the repository at this point in the history
  • Loading branch information
LangLangBart committed Mar 22, 2024
1 parent 04a503e commit ba8a7f1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gh-find-code
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,14 @@ if [[ $(command column -t <<<"A Z" 2>/dev/null) != *" "* ]]; then
die "Your 'column' command does not separate columns with at least two spaces. Please report this issue, stating your operating system and 'column' version."
fi

# If the history file is empty and MAX_LINES_HISTORY is greater than zero, add some examples.
if [[ ! -s $gh_find_code_history ]] && ((MAX_LINES_HISTORY)); then
cat <<'EOF' >"$gh_find_code_history"
repo:junegunn/fzf FZF_PORT
extension:rs "Hello, world!"
EOF
fi

# ===================== helper functions ==========================

# send a POST request to fzf
Expand Down

0 comments on commit ba8a7f1

Please sign in to comment.