fix executing hooks

The previous version seems to have ran `source` inside of subshell so
exported environment variables didn't take effect in the main process