mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-09-27 13:53:21 +08:00
fix: linux文件拷贝错误抛出异常
This commit is contained in:
10
public/node_modules/clipboard-event/index.js
generated
vendored
10
public/node_modules/clipboard-event/index.js
generated
vendored
@@ -22,9 +22,13 @@ class ClipboardEventListener extends EventEmitter {
|
||||
const target = path.resolve(targetPath, 'clipboard-event-handler-linux')
|
||||
const p = path.join(__dirname, 'platform/clipboard-event-handler-linux')
|
||||
if(!existsSync(target)) {
|
||||
mkdirSync(targetPath)
|
||||
copyFileSync(p, target)
|
||||
chmodSync(target, 0o755)
|
||||
try {
|
||||
mkdirSync(targetPath)
|
||||
copyFileSync(p, target)
|
||||
chmodSync(target, 0o755)
|
||||
} catch (error) {
|
||||
this.emit('error', error)
|
||||
}
|
||||
}
|
||||
this.child = execFile(target);
|
||||
}
|
||||
|
Reference in New Issue
Block a user