refactor: 移除添加监听时对Mac的特殊判断 移除了缺少监听器的报错通知

This commit is contained in:
ZiuChen
2022-11-02 23:16:22 +08:00
parent 18cbab4bda
commit bb83b2c4ff
3 changed files with 13 additions and 16 deletions

View File

@@ -12,7 +12,8 @@ class ClipboardEventListener extends EventEmitter {
startListening(dbPath) {
const targetMap = {
win32: 'clipboard-event-handler-win32.exe',
linux: 'clipboard-event-handler-linux'
linux: 'clipboard-event-handler-linux',
darwin: 'clipboard-event-handler-mac'
}
const { platform } = process
const target = path.resolve(
@@ -25,7 +26,7 @@ class ClipboardEventListener extends EventEmitter {
}
if (platform === 'win32') {
this.child = execFile(target)
} else if (platform === 'linux') {
} else if (platform === 'linux' || platform === 'darwin') {
chmodSync(target, 0o755)
this.child = execFile(target)
} else {