Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit536685c

Browse files
authored
Grdowns/update channel fix (microsoft#2637)
* Use shell optional arg* Add try/catch around spawn to override any possible exceptions* Default vsixname to cpptools-linux32.vsix* Move logFailure inline* Remove potential PII from error message to be on the safe side* Fix linter errors* Remove spawn optional arg; instead remove quotes surrounding command* Remove rethrowing of error at the top level checkAndApplyUpdate* Commenting* Remove default case in switch statement for vsixName; Add x86, i383, i686 cases
1 parentb6f1847 commit536685c

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

‎Extension/src/LanguageServer/extension.ts‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,10 @@ async function installVsix(vsixLocation: string, updateChannel: string): Promise
242242
cmdFile='code.cmd';
243243
}
244244
constvsCodeExeDir:string=path.dirname(process.execPath);
245-
return'"'+path.join(vsCodeExeDir,'bin',cmdFile)+'"';
245+
returnpath.join(vsCodeExeDir,'bin',cmdFile);
246246
}elseif(platformInfo.platform==='darwin'){
247-
return'"'+path.join(process.execPath,'..','..','..','..','..',
248-
'Resources','app','bin','code')+'"';
247+
returnpath.join(process.execPath,'..','..','..','..','..',
248+
'Resources','app','bin','code');
249249
}else{
250250
constvsCodeBinName:string=path.basename(process.execPath);
251251
try{
@@ -262,8 +262,13 @@ async function installVsix(vsixLocation: string, updateChannel: string): Promise
262262

263263
// Install the VSIX
264264
returnnewPromise<void>((resolve,reject)=>{
265-
letprocess:ChildProcess=spawn(vsCodeScriptPath,['--install-extension',vsixLocation]);
266-
if(process.pid===undefined){
265+
letprocess:ChildProcess;
266+
try{
267+
process=spawn(vsCodeScriptPath,['--install-extension',vsixLocation]);
268+
if(process.pid===undefined){
269+
thrownewError();
270+
}
271+
}catch(error){
267272
reject(newError('Failed to launch VS Code script process for installation'));
268273
return;
269274
}
@@ -296,10 +301,6 @@ async function installVsix(vsixLocation: string, updateChannel: string): Promise
296301
*@param updateChannel The user's updateChannel setting.
297302
*/
298303
asyncfunctioncheckAndApplyUpdate(updateChannel:string):Promise<void>{
299-
// Helper fn to avoid code duplication
300-
letlogFailure:(error:Error)=>void=(error:Error)=>{
301-
telemetry.logLanguageServerEvent('installVsix',{'error':error.message,'success':'false'});
302-
};
303304
// Wrap in new Promise to allow tmp.file callback to successfully resolve/reject
304305
// as tmp.file does not do anything with the callback functions return value
305306
constp:Promise<void>=newPromise<void>((resolve,reject)=>{
@@ -344,8 +345,10 @@ async function checkAndApplyUpdate(updateChannel: string): Promise<void> {
344345
});
345346
awaitp.catch((error:Error)=>{
346347
// Handle .then following getTargetBuildInfo rejection
347-
logFailure(error);
348-
throwerror;
348+
if(error.message.indexOf('/')!==-1||error.message.indexOf('\\')!==-1){
349+
error.message="Potential PII hidden";
350+
}
351+
telemetry.logLanguageServerEvent('installVsix',{'error':error.message,'success':'false'});
349352
});
350353
}
351354

‎Extension/src/githubAPI.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ function vsixNameForPlatform(info: PlatformInformation): string {
100100
case'darwin':return'cpptools-osx.vsix';
101101
default:{
102102
switch(platformInfo.architecture){
103-
case'x86':return'cpptools-linux32.vsix';
104103
case'x86_64':return'cpptools-linux.vsix';
104+
case'x86':
105+
case'i386':
106+
case'i686':return'cpptools-linux32.vsix';
105107
}
106108
}
107109
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp