From f1b83d5a88d9c303a2b145cb0dc67dddd18c9d5a Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 21 Sep 2023 13:21:00 -0800 Subject: [PATCH] Update xdg-basedir usage --- src/node/util.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/node/util.ts b/src/node/util.ts index 6d2993e2cd01..ecd880716a5c 100644 --- a/src/node/util.ts +++ b/src/node/util.ts @@ -8,7 +8,7 @@ import * as os from "os" import * as path from "path" import safeCompare from "safe-compare" import * as util from "util" -import xdgBasedir from "xdg-basedir" +import { xdgConfig, xdgData, xdgRuntime } from "xdg-basedir" import { vsRootPath } from "./constants" export interface Paths { @@ -65,10 +65,10 @@ export function getEnvPaths(platform = process.platform): Paths { return { // envPaths uses native directories so force Darwin to use the XDG spec // to align with other CLI tools. - data: xdgBasedir.data ? append(xdgBasedir.data) : paths.data, - config: xdgBasedir.config ? append(xdgBasedir.config) : paths.config, + data: xdgData ? append(xdgData) : paths.data, + config: xdgConfig ? append(xdgConfig) : paths.config, // Fall back to temp if there is no runtime dir. - runtime: xdgBasedir.runtime ? append(xdgBasedir.runtime) : paths.temp, + runtime: xdgRuntime ? append(xdgRuntime) : paths.temp, } case "win32": return { @@ -82,7 +82,7 @@ export function getEnvPaths(platform = process.platform): Paths { data: paths.data, config: paths.config, // Fall back to temp if there is no runtime dir. - runtime: xdgBasedir.runtime ? append(xdgBasedir.runtime) : paths.temp, + runtime: xdgRuntime ? append(xdgRuntime) : paths.temp, } } }