mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-20 17:43:24 +00:00
Fix PathUtils.isInRoot on windows
This commit is contained in:
@@ -8,7 +8,13 @@ function normalizePath(filename) {
|
||||
|
||||
// Return true if file path is inside a folder
|
||||
function isInRoot(root, filename) {
|
||||
root = path.normalize(root);
|
||||
filename = path.normalize(filename);
|
||||
|
||||
if (root[root.length - 1] != path.sep) {
|
||||
root = root + path.sep;
|
||||
}
|
||||
|
||||
return (filename.substr(0, root.length) === root);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user