@@ -12,7 +12,7 @@ import { requireModule, requireFork, forkModule } from "./vscode/bootstrapFork";
1212import { SharedProcess , SharedProcessState } from "./vscode/sharedProcess" ;
1313import { setup as setupNativeModules } from "./modules" ;
1414import { fillFs } from "./fill" ;
15- import { isCli , serveStatic , buildDir } from "./constants" ;
15+ import { isCli , serveStatic , buildDir , dataHome , cacheHome } from "./constants" ;
1616import opn = require( "opn" ) ;
1717
1818export class Entry extends Command {
@@ -49,7 +49,7 @@ export class Entry extends Command {
4949 }
5050
5151 const { args, flags } = this . parse ( Entry ) ;
52- const dataDir = path . resolve ( flags [ "data-dir" ] || path . join ( os . homedir ( ) , ". code-server" ) ) ;
52+ const dataDir = path . resolve ( flags [ "data-dir" ] || path . join ( dataHome , "code-server" ) ) ;
5353 const workingDir = path . resolve ( args [ "workdir" ] ) ;
5454
5555 setupNativeModules ( dataDir ) ;
@@ -81,7 +81,11 @@ export class Entry extends Command {
8181 fs . mkdirSync ( dataDir ) ;
8282 }
8383
84- const logDir = path . join ( dataDir , "logs" , new Date ( ) . toISOString ( ) . replace ( / [ - : . T Z ] / g, "" ) ) ;
84+ if ( ! fs . existsSync ( cacheHome ) ) {
85+ fs . mkdirSync ( cacheHome ) ;
86+ }
87+
88+ const logDir = path . join ( cacheHome , "code-server/logs" , new Date ( ) . toISOString ( ) . replace ( / [ - : . T Z ] / g, "" ) ) ;
8589 process . env . VSCODE_LOGS = logDir ;
8690
8791 const certPath = flags . cert ? path . resolve ( flags . cert ) : undefined ;
0 commit comments