alternative Pkg.clone without regex

This is a potential alternative to #6141 - but I need help testing to see if `basename` works the same on windows.