Fix substring returning last character of src dir

The getSubPath method was returning the last character of the src dir resulting in new directories being created when using cwd or file patterns.