_project_name_chpwd_hook() { export PROJECT_NAME="${PWD##*/}" } chpwd_functions+=( _project_name_chpwd_hook ) _project_name_chpwd_hook