Skip to content

Commit f1b83d5

Browse files
committed
Update xdg-basedir usage
1 parent a9028c9 commit f1b83d5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/node/util.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as os from "os"
88
import * as path from "path"
99
import safeCompare from "safe-compare"
1010
import * as util from "util"
11-
import xdgBasedir from "xdg-basedir"
11+
import { xdgConfig, xdgData, xdgRuntime } from "xdg-basedir"
1212
import { vsRootPath } from "./constants"
1313

1414
export interface Paths {
@@ -65,10 +65,10 @@ export function getEnvPaths(platform = process.platform): Paths {
6565
return {
6666
// envPaths uses native directories so force Darwin to use the XDG spec
6767
// to align with other CLI tools.
68-
data: xdgBasedir.data ? append(xdgBasedir.data) : paths.data,
69-
config: xdgBasedir.config ? append(xdgBasedir.config) : paths.config,
68+
data: xdgData ? append(xdgData) : paths.data,
69+
config: xdgConfig ? append(xdgConfig) : paths.config,
7070
// Fall back to temp if there is no runtime dir.
71-
runtime: xdgBasedir.runtime ? append(xdgBasedir.runtime) : paths.temp,
71+
runtime: xdgRuntime ? append(xdgRuntime) : paths.temp,
7272
}
7373
case "win32":
7474
return {
@@ -82,7 +82,7 @@ export function getEnvPaths(platform = process.platform): Paths {
8282
data: paths.data,
8383
config: paths.config,
8484
// Fall back to temp if there is no runtime dir.
85-
runtime: xdgBasedir.runtime ? append(xdgBasedir.runtime) : paths.temp,
85+
runtime: xdgRuntime ? append(xdgRuntime) : paths.temp,
8686
}
8787
}
8888
}

0 commit comments

Comments
 (0)