File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,12 @@ import * as os from "os"
7
7
import * as path from "path"
8
8
import * as util from "util"
9
9
import xdgBasedir from "xdg-basedir"
10
+ import { tmpdir } from "./constants"
10
11
11
12
interface Paths {
12
13
data : string
13
14
config : string
15
+ runtime : string
14
16
}
15
17
16
18
export const paths = getEnvPaths ( )
@@ -20,19 +22,23 @@ export const paths = getEnvPaths()
20
22
* On MacOS this function gets the standard XDG directories instead of using the native macOS
21
23
* ones. Most CLIs do this as in practice only GUI apps use the standard macOS directories.
22
24
*/
23
- function getEnvPaths ( ) : Paths {
25
+ export function getEnvPaths ( ) : Paths {
24
26
let paths : Paths
25
27
if ( process . platform === "win32" ) {
26
- paths = envPaths ( "code-server" , {
27
- suffix : "" ,
28
- } )
28
+ paths = {
29
+ ...envPaths ( "code-server" , {
30
+ suffix : "" ,
31
+ } ) ,
32
+ runtime : tmpdir ,
33
+ }
29
34
} else {
30
35
if ( xdgBasedir . data === undefined || xdgBasedir . config === undefined ) {
31
36
throw new Error ( "No home folder?" )
32
37
}
33
38
paths = {
34
39
data : path . join ( xdgBasedir . data , "code-server" ) ,
35
40
config : path . join ( xdgBasedir . config , "code-server" ) ,
41
+ runtime : xdgBasedir . runtime ? path . join ( xdgBasedir . runtime , "code-server" ) : tmpdir ,
36
42
}
37
43
}
38
44
You can’t perform that action at this time.
0 commit comments