@@ -25,7 +25,7 @@ export class IIS {
25
25
this . _args = args ;
26
26
}
27
27
28
- public startWebsite ( settings ?: settings . Isettings ) : process . ChildProcess {
28
+ public startWebsite ( options ?: settings . Isettings ) : process . ChildProcess {
29
29
//Need to run this command
30
30
//iisexpress /path:app-path [/port:port-number] [/clr:clr-version] [/systray:boolean]
31
31
//isexpress /path:c:\myapp\ /port:5005
@@ -41,17 +41,16 @@ export class IIS {
41
41
}
42
42
43
43
//Get IIS Port Number from config file
44
- this . _args . port = settings . port ;
44
+ this . _args . port = options . port ;
45
45
46
46
//Folder to run as the arg
47
- this . _args . path = settings . path ? settings . path : vscode . workspace . rootPath ;
47
+ this . _args . path = options . path ? options . path : vscode . workspace . rootPath ;
48
48
49
49
//CLR version, yes there are still people on 3.5
50
- this . _args . clr = settings . clr ;
50
+ this . _args . clr = options . clr ? options . clr : settings . clrVersion . v40 ;
51
51
52
52
//This is the magic that runs the IISExpress cmd
53
53
this . _iisProcess = process . spawn ( this . _iisPath , [ `-path:${ this . _args . path } ` , `-port:${ this . _args . port } ` , `-clr:${ this . _args . clr } ` ] ) ;
54
- console . log ( `stdout: Command with Params ${ this . _iisPath } ${ [ `-path:${ this . _args . path } ` , `-port:${ this . _args . port } ` , `-clr:${ this . _args . clr } ` ] . join ( ' ' ) } ` ) ;
55
54
56
55
//Create output channel & show it
57
56
this . _output = this . _output || vscode . window . createOutputChannel ( 'IIS Express' ) ;
@@ -68,7 +67,7 @@ export class IIS {
68
67
this . _statusbar . show ( ) ;
69
68
70
69
//Open browser
71
- this . openWebsite ( settings ) ;
70
+ this . openWebsite ( options ) ;
72
71
73
72
//Attach all the events & functions to iisProcess
74
73
this . _iisProcess . stdout . on ( 'data' , ( data ) => {
@@ -119,7 +118,7 @@ export class IIS {
119
118
120
119
}
121
120
122
- public openWebsite ( settings ?: settings . Isettings ) {
121
+ public openWebsite ( options ?: settings . Isettings ) {
123
122
124
123
//If we do not have an iisProcess running
125
124
if ( ! this . _iisProcess ) {
@@ -130,9 +129,9 @@ export class IIS {
130
129
}
131
130
132
131
133
- if ( settings && settings . url ) {
132
+ if ( options && options . url ) {
134
133
//We have a starting URL set - but lets ensure we strip starting / if present
135
- let startUrl = settings . url . startsWith ( '/' ) ? settings . url . substring ( 1 ) : settings . url ;
134
+ let startUrl = options . url . startsWith ( '/' ) ? options . url . substring ( 1 ) : options . url ;
136
135
137
136
//Start browser with start url
138
137
let browser = process . exec ( `start http://localhost:${ this . _args . port } /${ startUrl } ` ) ;
@@ -142,16 +141,16 @@ export class IIS {
142
141
}
143
142
}
144
143
145
- public restartSite ( settings ? : settings . Isettings ) {
144
+ public restartSite ( options ? : settings . Isettings ) {
146
145
//If we do not have an iisProcess/website running
147
146
if ( ! this . _iisProcess ) {
148
147
//Then just do a start site...
149
- this . startWebsite ( settings ) ;
148
+ this . startWebsite ( options ) ;
150
149
}
151
150
else {
152
151
//It's already running so stop it first then, start it
153
152
this . stopWebsite ( ) ;
154
- this . startWebsite ( settings ) ;
153
+ this . startWebsite ( options ) ;
155
154
}
156
155
157
156
}
0 commit comments