Skip to content

Instantly share code, notes, and snippets.

@jotafeldmann
Created January 23, 2025 23:33
Show Gist options
  • Save jotafeldmann/31a42df6941453d05fc50ea0f1ecff8d to your computer and use it in GitHub Desktop.
Save jotafeldmann/31a42df6941453d05fc50ea0f1ecff8d to your computer and use it in GitHub Desktop.
save-path.sh
# . save-path.sh
# . save-path.sh save
SAVE_PATH_FILE=$1
OPTION=$2
if [ "$OPTION" = "save" ]; then
echo $PWD > $SAVE_PATH_FILE
elif [ "$OPTION" = "create" ]; then
touch $SAVE_PATH_FILE
elif [ "$OPTION" = "last" ]; then
cat $SAVE_PATH_FILE
elif [ "$OPTION" = "config" ]; then
echo $SAVE_PATH_FILE
else
cd $(cat $SAVE_PATH_FILE)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment