@@ -10,6 +10,7 @@ import { requireModule } from "./vscode/bootstrapFork";
10
10
import { SharedProcess , SharedProcessState } from "./vscode/sharedProcess" ;
11
11
import { setup as setupNativeModules } from "./modules" ;
12
12
import { fillFs } from "./fill" ;
13
+ import { isCli , serveStatic , buildDir } from "./constants" ;
13
14
14
15
export class Entry extends Command {
15
16
public static description = "Start your own self-hosted browser-accessible VS Code" ;
@@ -50,7 +51,7 @@ export class Entry extends Command {
50
51
logger . warn ( "Failed to remove extracted dependency." , field ( "dependency" , "spdlog" ) , field ( "error" , ex . message ) ) ;
51
52
}
52
53
53
- if ( process . env . CLI ) {
54
+ if ( isCli ) {
54
55
fillFs ( ) ;
55
56
}
56
57
@@ -60,7 +61,7 @@ export class Entry extends Command {
60
61
Object . assign ( process . env , JSON . parse ( flags . env ) ) ;
61
62
}
62
63
63
- const builtInExtensionsDir = path . join ( process . env . BUILD_DIR || path . join ( __dirname , ".." ) , "build/extensions" ) ;
64
+ const builtInExtensionsDir = path . join ( buildDir || path . join ( __dirname , ".." ) , "build/extensions" ) ;
64
65
if ( flags [ "bootstrap-fork" ] ) {
65
66
const modulePath = flags [ "bootstrap-fork" ] ;
66
67
if ( ! modulePath ) {
@@ -74,8 +75,8 @@ export class Entry extends Command {
74
75
const dataDir = flags [ "data-dir" ] || path . join ( os . homedir ( ) , ".vscode-remote" ) ;
75
76
const workingDir = args [ "workdir" ] ;
76
77
77
- if ( process . env . BUILD_DIR && process . env . BUILD_DIR . startsWith ( workingDir ) ) {
78
- logger . error ( "Cannot run binary inside of BUILD_DIR" , field ( "build_dir" , process . env . BUILD_DIR ) , field ( "cwd" , process . cwd ( ) ) ) ;
78
+ if ( buildDir && buildDir . startsWith ( workingDir ) ) {
79
+ logger . error ( "Cannot run binary inside of BUILD_DIR" , field ( "build_dir" , buildDir ) , field ( "cwd" , process . cwd ( ) ) ) ;
79
80
process . exit ( 1 ) ;
80
81
}
81
82
@@ -114,7 +115,7 @@ export class Entry extends Command {
114
115
115
116
next ( ) ;
116
117
} ) ;
117
- if ( ( process . env . CLI === "false" || ! process . env . CLI ) && ! process . env . SERVE_STATIC ) {
118
+ if ( ! isCli && ! serveStatic ) {
118
119
const webpackConfig = require ( path . join ( __dirname , ".." , ".." , "web" , "webpack.config.js" ) ) ;
119
120
const compiler = require ( "webpack" ) ( webpackConfig ) ;
120
121
app . use ( require ( "webpack-dev-middleware" ) ( compiler , {
@@ -163,6 +164,6 @@ export class Entry extends Command {
163
164
}
164
165
165
166
Entry . run ( undefined , {
166
- root : process . env . BUILD_DIR as string || __dirname ,
167
+ root : buildDir || __dirname ,
167
168
//@ts -ignore
168
169
} ) . catch ( require ( "@oclif/errors/handle" ) ) ;
0 commit comments