From f8cfd4fae6833e61ea1140b84b642236925666ca Mon Sep 17 00:00:00 2001 From: metacryst Date: Fri, 12 Jan 2024 07:53:07 -0600 Subject: [PATCH] Fix Path.full() for windows --- path.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/path.js b/path.js index b402195..3c29f51 100644 --- a/path.js +++ b/path.js @@ -16,9 +16,9 @@ class PathProcessor { full() { if(!this.node) return; - const os = require('os') - const paths = require('path') - this.path = paths.join(os.homedir(), this.path) + let path = this.path; + this.path = "" + this.join(Path.homedir(), path) return this; } @@ -140,7 +140,8 @@ export default class Path { static homedir() { if(typeof module === 'undefined' || !module.exports) return; 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 } }