Get dirname of a module according to current path
string
$current_path = null
path to where the function is called
$dirname