You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Please give the trailing slash back to os.tmpdir() #1669
Since we can get any string (like "/oh/my/xxx/////"), from the environment, why bother to remove the trailing slash? For consistency between __dirname and os.tmpdir() #715#747 ??
If the string "/" comes from the user environment (though hardly possible), gets trimmed into "", what directory does it represent (and on what platform)?
@tellnes Yeah, that sounds like a solid workaround.
@jakwings would that satisfy you? I realize this is a breaking change and that you'd have to normalize it through the library, but isn't that a one-time thing and the new behavior makes more sense?
As of 7693705, trailing slashes will not be stripped from / or C:\. Additionally, only slashes relevant to the current operating system will be stripped.
Activity
mscdex commentedon May 10, 2015
Why not use
path.join()or similarpathmethods?rlidwka commentedon May 10, 2015
That's true actually:
/should not be removed if it's the only character there.dirname works correctly in that case:
$ cat /test.js console.log(__dirname) $ ~/io.js/iojs /test.js /Fishrock123 commentedon May 10, 2015
cc @tellnes
brendanashworth commentedon May 10, 2015
Perhaps semver-major changes aren't looked at hard enough... maybe we should introduce a hard minimum amount of reviewers for a major change, say 3.
tellnes commentedon May 10, 2015
We could change it so we remove all trailing slashes and keep one if there is no other characters there?
benjamingr commentedon May 10, 2015
@tellnes Yeah, that sounds like a solid workaround.
@jakwings would that satisfy you? I realize this is a breaking change and that you'd have to normalize it through the library, but isn't that a one-time thing and the new behavior makes more sense?
tellnes commentedon May 11, 2015
So remove trailing
path.septhen, but keep one if there is no other characters?os: refine tmpdir() trailing slash stripping
cjihrig commentedon May 13, 2015
As of 7693705, trailing slashes will not be stripped from
/orC:\. Additionally, only slashes relevant to the current operating system will be stripped.