Fix Path.full() for windows

This commit is contained in:
metacryst
2024-01-12 07:53:07 -06:00
parent 110ec82b8e
commit f8cfd4fae6

View File

@@ -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
} }
} }