Sdir/rdir open EDITOR after cd

This commit is contained in:
z3rOR0ne 2022-12-13 16:07:02 -08:00
parent fb573e6151
commit 0e14683cf1
2 changed files with 10 additions and 1 deletions

View file

@ -12,4 +12,8 @@ else
exit 1
fi
cd "$sdir" && ls
if [ -z "$sdoc" ] ; then
cd "$sdir" && ls
else
cd "$sdir" && $EDITOR $sdoc
fi

View file

@ -13,6 +13,11 @@ if [[ ! -f "$sdir" ]] ; then
/usr/bin/touch "$sdir"
fi
if [[ $# -gt 0 ]] ; then
sdoc="$1"
fi
echo 'export sdir='"$sdir" > "$sdrc"
echo 'export sdoc='"$sdoc" >> "$sdrc"
# immediately source ~/.sdrc
source "$sdrc"