@@ -49,11 +49,11 @@ export class Entry extends Command {
4949 }
5050
5151 const { args, flags } = this . parse ( Entry ) ;
52- const dataDir = flags [ "data-dir" ] || path . join ( os . homedir ( ) , ".code-server" ) ;
53- const workingDir = args [ "workdir" ] ;
52+ const dataDir = path . resolve ( flags [ "data-dir" ] || path . join ( os . homedir ( ) , ".code-server" ) ) ;
53+ const workingDir = path . resolve ( args [ "workdir" ] ) ;
5454
5555 setupNativeModules ( dataDir ) ;
56- const builtInExtensionsDir = path . join ( buildDir || path . join ( __dirname , ".." ) , "build/extensions" ) ;
56+ const builtInExtensionsDir = path . resolve ( buildDir || path . join ( __dirname , ".." ) , "build/extensions" ) ;
5757 if ( flags [ "bootstrap-fork" ] ) {
5858 const modulePath = flags [ "bootstrap-fork" ] ;
5959 if ( ! modulePath ) {
@@ -84,8 +84,8 @@ export class Entry extends Command {
8484 const logDir = path . join ( dataDir , "logs" , new Date ( ) . toISOString ( ) . replace ( / [ - : . T Z ] / g, "" ) ) ;
8585 process . env . VSCODE_LOGS = logDir ;
8686
87- const certPath = flags . cert ;
88- const certKeyPath = flags [ "cert-key" ] ;
87+ const certPath = flags . cert ? path . resolve ( flags . cert ) : undefined ;
88+ const certKeyPath = flags [ "cert-key" ] ? path . resolve ( flags [ "cert-key" ] ) : undefined ;
8989
9090 if ( certPath && ! certKeyPath ) {
9191 logger . error ( "'--cert-key' flag is required when specifying a certificate!" ) ;
@@ -135,9 +135,9 @@ export class Entry extends Command {
135135 }
136136 } ) ;
137137
138- let password = flags [ " password" ] ;
138+ let password = flags . password ;
139139 if ( ! password ) {
140- // Generate a random password
140+ // Generate a random password with a length of 24.
141141 const buffer = Buffer . alloc ( 12 ) ;
142142 randomFillSync ( buffer ) ;
143143 password = buffer . toString ( "hex" ) ;
@@ -158,7 +158,7 @@ export class Entry extends Command {
158158 // If we're not running from the binary and we aren't serving the static
159159 // pre-built version, use webpack to serve the web files.
160160 if ( ! isCli && ! serveStatic ) {
161- const webpackConfig = require ( path . join ( __dirname , ".." , ".." , "web" , "webpack.config.js" ) ) ;
161+ const webpackConfig = require ( path . resolve ( __dirname , ".." , ".." , "web" , "webpack.config.js" ) ) ;
162162 const compiler = require ( "webpack" ) ( webpackConfig ) ;
163163 app . use ( require ( "webpack-dev-middleware" ) ( compiler , {
164164 logger,
0 commit comments