提交 b9ac1023 编写于 作者: B Benjamin Pasero

macOS: help icon refresh

上级 93a3cfc3
......@@ -54,8 +54,13 @@ import { KeyboardLayoutMonitor } from 'vs/code/electron-main/keyboard';
import URI from 'vs/base/common/uri';
import { WorkspacesChannel } from 'vs/platform/workspaces/common/workspacesIpc';
import { IWorkspacesMainService } from 'vs/platform/workspaces/common/workspaces';
import { dirname, join } from 'path';
import { touch } from 'vs/base/node/pfs';
export class CodeApplication {
private static APP_ICON_REFRESH_KEY = 'macOSAppIconRefresh';
private toDispose: IDisposable[];
private windowsMainService: IWindowsMainService;
......@@ -386,6 +391,20 @@ export class CodeApplication {
// Start shared process here
this.sharedProcess.spawn();
// Helps application icon refresh after an update with new icon is installed (macOS)
// TODO@Ben remove after a couple of releases
if (platform.isMacintosh) {
if (!this.storageService.getItem(CodeApplication.APP_ICON_REFRESH_KEY)) {
this.storageService.setItem(CodeApplication.APP_ICON_REFRESH_KEY, true);
// 'exe' => /Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron
const appPath = dirname(dirname(dirname(app.getPath('exe'))));
const infoPlistPath = join(appPath, 'Contents', 'Info.plist');
touch(appPath).done(null, error => { /* ignore */ });
touch(infoPlistPath).done(null, error => { /* ignore */ });
}
}
}
private dispose(): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册