Check if process exists
This commit is contained in:
parent
03a2bf8dd7
commit
475370b7c9
1 changed files with 8 additions and 1 deletions
|
@ -206,7 +206,7 @@ class Preview extends Disposable {
|
|||
private async getWebviewContents(): Promise<string> {
|
||||
const version = Date.now().toString();
|
||||
const settings = {
|
||||
isMac: process.platform === 'darwin',
|
||||
isMac: isMac(),
|
||||
src: await this.getResourcePath(this.webviewEditor, this.resource, version),
|
||||
};
|
||||
|
||||
|
@ -262,6 +262,13 @@ class Preview extends Disposable {
|
|||
}
|
||||
}
|
||||
|
||||
function isMac(): boolean {
|
||||
if (typeof process === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
return process.platform === 'darwin';
|
||||
}
|
||||
|
||||
function escapeAttribute(value: string | vscode.Uri): string {
|
||||
return value.toString().replace(/"/g, '"');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue