op: only display directories that has a git repo in it
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
# TODO:
|
||||
# - Create fuzzy finder for cht.sh & tldr + system man pages + learnxinyminutes github
|
||||
|
||||
|
||||
# Quick open project files in NVIM
|
||||
op() {
|
||||
if ! command -v fzf >/dev/null; then
|
||||
@@ -14,7 +13,7 @@ op() {
|
||||
# %T => Sort by last modified
|
||||
# @ => time displayed in seconds (since 1.1.1970)
|
||||
# %p => Directory path
|
||||
project_dir="$(find -L ~/Code -mindepth 2 -maxdepth 2 -not -path '*/.*' -printf "%T@ %p\n" | sort -nr | cut -d ' ' -f 2- | fzf --prompt='Select a project: ')"
|
||||
project_dir="$(find -L ~/Code -mindepth 1 -maxdepth 5 -name ".git" -not -path '*/.stversions/*' -printf "%T@ %p\n" | sort -nr | cut -d ' ' -f 2- | xargs dirname | fzf --prompt='Select a project: ')"
|
||||
|
||||
# Do nothing and return if user cancelled out
|
||||
if [ "$project_dir" = "" ]; then
|
||||
|
||||
Reference in New Issue
Block a user