mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-12-21 06:27:18 +00:00
fix: removed unsafe shell when executing process
Ref: PNX-3671 Co-authored-by: per1234 <accounts@perglass.com> Co-authored-by: Akos Kitta <a.kitta@arduino.cc> Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
@@ -1,35 +1,19 @@
|
||||
import { injectable, inject } from '@theia/core/shared/inversify';
|
||||
import { ILogger } from '@theia/core/lib/common/logger';
|
||||
import { FileUri } from '@theia/core/lib/node/file-uri';
|
||||
import { getExecPath } from './exec-util';
|
||||
import { injectable } from '@theia/core/shared/inversify';
|
||||
import { ExecutableService } from '../common/protocol/executable-service';
|
||||
import { getExecPath } from './exec-util';
|
||||
|
||||
@injectable()
|
||||
export class ExecutableServiceImpl implements ExecutableService {
|
||||
@inject(ILogger)
|
||||
protected logger: ILogger;
|
||||
|
||||
async list(): Promise<{
|
||||
clangdUri: string;
|
||||
cliUri: string;
|
||||
lsUri: string;
|
||||
fwuploaderUri: string;
|
||||
}> {
|
||||
const [ls, clangd, cli, fwuploader] = await Promise.all([
|
||||
getExecPath('arduino-language-server', this.onError.bind(this)),
|
||||
getExecPath('clangd', this.onError.bind(this), undefined),
|
||||
getExecPath('arduino-cli', this.onError.bind(this)),
|
||||
getExecPath('arduino-fwuploader', this.onError.bind(this)),
|
||||
]);
|
||||
return {
|
||||
clangdUri: FileUri.create(clangd).toString(),
|
||||
cliUri: FileUri.create(cli).toString(),
|
||||
lsUri: FileUri.create(ls).toString(),
|
||||
fwuploaderUri: FileUri.create(fwuploader).toString(),
|
||||
clangdUri: FileUri.create(getExecPath('clangd')).toString(),
|
||||
cliUri: FileUri.create(getExecPath('arduino-cli')).toString(),
|
||||
lsUri: FileUri.create(getExecPath('arduino-language-server')).toString(),
|
||||
};
|
||||
}
|
||||
|
||||
protected onError(error: Error): void {
|
||||
this.logger.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user