new path homedir() method
This commit is contained in:
6
path.js
6
path.js
@@ -136,6 +136,12 @@ export default class Path {
|
|||||||
static join(...segments) {
|
static join(...segments) {
|
||||||
return new PathProcessor(null).join(...segments);
|
return new PathProcessor(null).join(...segments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static homedir() {
|
||||||
|
if(typeof module === 'undefined' || !module.exports) return;
|
||||||
|
const os = require('os')
|
||||||
|
return os.homedir().replace(/\\/g, '/').replace(/^[a-zA-Z]:/, '');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.Path = Path;
|
window.Path = Path;
|
||||||
Reference in New Issue
Block a user