Fix Path.full() for windows
This commit is contained in:
9
path.js
9
path.js
@@ -16,9 +16,9 @@ class PathProcessor {
|
|||||||
|
|
||||||
full() {
|
full() {
|
||||||
if(!this.node) return;
|
if(!this.node) return;
|
||||||
const os = require('os')
|
let path = this.path;
|
||||||
const paths = require('path')
|
this.path = ""
|
||||||
this.path = paths.join(os.homedir(), this.path)
|
this.join(Path.homedir(), path)
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,7 +140,8 @@ export default class Path {
|
|||||||
static homedir() {
|
static homedir() {
|
||||||
if(typeof module === 'undefined' || !module.exports) return;
|
if(typeof module === 'undefined' || !module.exports) return;
|
||||||
const os = require('os')
|
const os = require('os')
|
||||||
return os.homedir().replace(/\\/g, '/').replace(/^[a-zA-Z]:/, '');
|
let ret = os.homedir().replace(/\\/g, '/').replace(/^[a-zA-Z]:/, '');
|
||||||
|
return ret
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user