From 81a615b8119ea39927d2ac99de932fd2971e53c8 Mon Sep 17 00:00:00 2001 From: la-ninpre Date: Mon, 31 May 2021 11:41:23 +0300 Subject: move fslcd back to bashrc when it is separate script it's not working, because cd works only when script is running, but when it exits, working directory stays the same. maybe there's a way to do it differently, but for now it will remain just a function inside bashrc. --- .bashrc | 6 ++++++ .local/bin/fslcd | 10 ---------- 2 files changed, 6 insertions(+), 10 deletions(-) delete mode 100755 .local/bin/fslcd diff --git a/.bashrc b/.bashrc index 587a605..7566e80 100644 --- a/.bashrc +++ b/.bashrc @@ -42,6 +42,12 @@ export FZF_CTRL_T_COMMAND='$FZF_DEFAULT_COMMAND' FOSSILS_HOME=$HOME/Documents/Fossils export FOSSILS_HOME +# quickly cd into fossil repo +fslcd() { + _fsl_checkout=$(fossil all ls -c | fzf +m) + cd "$_fsl_checkout" || return +} + # starship prompt eval "$(starship init bash)" diff --git a/.local/bin/fslcd b/.local/bin/fslcd deleted file mode 100755 index 4045ff9..0000000 --- a/.local/bin/fslcd +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# script to quickly get to any fossil repo using fzf - -main() { - _fsl_checkout=$(fossil all ls -c | fzf +m) && - cd "$_fsl_checkout" || return -} - -main "$@" -- cgit v1.2.3