File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import * as cp from "child_process" ;
22import * as os from "os" ;
3+ import * as path from "path" ;
34import { setUnexpectedErrorHandler } from "vs/base/common/errors" ;
45import { main as vsCli } from "vs/code/node/cliProcessMain" ;
56import { validatePaths } from "vs/code/node/paths" ;
@@ -73,7 +74,15 @@ const getArgs = (): Args => {
7374
7475 options . push ( last ) ;
7576
76- return validatePaths ( parseMainProcessArgv ( process . argv ) ) ;
77+ const args = parseMainProcessArgv ( process . argv ) ;
78+ if ( ! args [ "user-data-dir" ] ) {
79+ args [ "user-data-dir" ] = path . join ( process . env . XDG_DATA_HOME || path . join ( os . homedir ( ) , ".local/share" ) , "code-server" ) ;
80+ }
81+ if ( ! args [ "extensions-dir" ] ) {
82+ args [ "extensions-dir" ] = path . join ( args [ "user-data-dir" ] , "extensions" ) ;
83+ }
84+
85+ return validatePaths ( args ) ;
7786} ;
7887
7988const startVscode = async ( ) : Promise < void | void [ ] > => {
You can’t perform that action at this time.
0 commit comments