Fix cli incompatibility with Windows

When checking for the last slash, use DIRECTORY_SEPARATOR to make the script work correctly when executed under Windows.

PS: can be applied to earlier versions
Merge pull request #167 from kissifrot/patch-1

Fix cli incompatibility with Windows