strip possible trailing slash on target dir