Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Convert slashes in DOS path strings to linux
- * @use replace(/\\/g, '/')
- *
- * And
- *
- * Replace drive letter and colon with 'cygwin/' then the drive letter
- * @use .replace(/^(\w):/i, 'cygwin/$1')
- **/
- var dir = process.cwd().replace(/\\/g, '/').replace(/^(\w):/i, 'cygwin/$1');
- /* NOTE: If using in a script, (i.e. not CLI), it is possible to substitute 'process.cwd()'
- * With '__dirname'
- * Or
- * If using 'require('path') then 'path.resolve() will also work
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement