Here are two helpful tips for finding the working directory.
To get the directory hosting a script no matter where you call the script from use this command:
DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
If a directory host a local git project, you can get the root directory by calling this command:
DIR="$(git rev-parse --show-toplevel)"