Double-click bash file -> pwd outputs my home directory instead of the current directory
Scripts/commands are always run from your home directory (which may be inconvenient for scripts run both from Terminal and from Finder). To find the directory they are stored in you need to look at $0 (which contains the full path and name of the script):

#!/bin/bash
echo '$0:' $0
echo 'Script stored at:' ${0%/*}
cd "${0%/*}"
pwd