Skip to content

Commit bb93750

Browse files
author
Warren Buckley
committed
Change variable name settings as clashed with import of settings class - set fallback to CLR v4 if not set in settings JSON config file
1 parent d4ca674 commit bb93750

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/IISExpress.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class IIS {
2525
this._args = args;
2626
}
2727

28-
public startWebsite(settings?: settings.Isettings): process.ChildProcess{
28+
public startWebsite(options?: settings.Isettings): process.ChildProcess{
2929
//Need to run this command
3030
//iisexpress /path:app-path [/port:port-number] [/clr:clr-version] [/systray:boolean]
3131
//isexpress /path:c:\myapp\ /port:5005
@@ -41,17 +41,16 @@ export class IIS {
4141
}
4242

4343
//Get IIS Port Number from config file
44-
this._args.port = settings.port;
44+
this._args.port = options.port;
4545

4646
//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;
4848

4949
//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;
5151

5252
//This is the magic that runs the IISExpress cmd
5353
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(' ')}`);
5554

5655
//Create output channel & show it
5756
this._output = this._output || vscode.window.createOutputChannel('IIS Express');
@@ -68,7 +67,7 @@ export class IIS {
6867
this._statusbar.show();
6968

7069
//Open browser
71-
this.openWebsite(settings);
70+
this.openWebsite(options);
7271

7372
//Attach all the events & functions to iisProcess
7473
this._iisProcess.stdout.on('data', (data) =>{
@@ -119,7 +118,7 @@ export class IIS {
119118

120119
}
121120

122-
public openWebsite(settings?: settings.Isettings){
121+
public openWebsite(options?: settings.Isettings){
123122

124123
//If we do not have an iisProcess running
125124
if(!this._iisProcess){
@@ -130,9 +129,9 @@ export class IIS {
130129
}
131130

132131

133-
if (settings && settings.url) {
132+
if (options && options.url) {
134133
//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;
136135

137136
//Start browser with start url
138137
let browser = process.exec(`start http://localhost:${this._args.port}/${startUrl}`);
@@ -142,16 +141,16 @@ export class IIS {
142141
}
143142
}
144143

145-
public restartSite(settings? : settings.Isettings){
144+
public restartSite(options? : settings.Isettings){
146145
//If we do not have an iisProcess/website running
147146
if(!this._iisProcess){
148147
//Then just do a start site...
149-
this.startWebsite(settings);
148+
this.startWebsite(options);
150149
}
151150
else {
152151
//It's already running so stop it first then, start it
153152
this.stopWebsite();
154-
this.startWebsite(settings);
153+
this.startWebsite(options);
155154
}
156155

157156
}

0 commit comments

Comments
 (0)