cmdmod: rm redundant check that CWD is a directory

already performing that check on new line # 329
Merge pull request #7165 from cvrebert/patch-2

cmdmod: rm redundant check that CWD is a directory