switched to new way :)
This commit is contained in:
parent
b03a2a25f1
commit
f22d182c8f
30 changed files with 0 additions and 0 deletions
13
src-old/util/clipboard.ts
Normal file
13
src-old/util/clipboard.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { execSync } from 'child_process';
|
||||
|
||||
export function readClipboard(): string {
|
||||
try {
|
||||
return execSync('powershell -command "Get-Clipboard"', { encoding: 'utf-8' }).trim();
|
||||
} catch {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
export function writeClipboard(text: string): void {
|
||||
execSync(`powershell -command "Set-Clipboard -Value '${text.replace(/'/g, "''")}'"`);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue