I have this function
snip-git(){
cd ${snippetdir}
git add .
git commit -m "."
git push -u
}
When git finishes pushing the changes, I want to get back to the directory I was when I called snip-git.
I tried this
snip-git(){
cwd=$(pwd)
cd ${snippetdir}
...
cd cwd
}
But it ends up reading the ned directory rather than the old one